Python 3 Oneliners

HTTP Server

python3 comes with its own builtin http server. Useful for quick prototyping or sharing a folder or file up with the quickness.

  • python3 -m http.server 8000

This serves the pwd over every available interface on port 8000.

  • python3 -m http.server –bind 127.0.0.1 –directory /foo/bar/

This serves /foo/bar/ on the localhost/lo1 interface.