Skip to content

Instantly share code, notes, and snippets.

@tilast
Forked from nepsilon/3-python-module-you-can-use-on-cli.md
Created April 26, 2016 09:19
Show Gist options
  • Save tilast/ae37f436b578332aaf4b715312041124 to your computer and use it in GitHub Desktop.
Save tilast/ae37f436b578332aaf4b715312041124 to your computer and use it in GitHub Desktop.
3 Python modules you can use directly on the CLI
# Start a local webserver to serve the file of your current directory on the LAN:
# Python version 2.x:
python -m SimpleHTTPServer
# Python version 3.x:
python3 -m http.server
#Start a local SMTP server to debug your app emails. Emails will be printed on stdout:
python -m smtpd -c DebuggingServer -n
#Parse and prettify a JSON string with:
cat mydata.json | python -m json.tool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment