Skip to content

Instantly share code, notes, and snippets.

@nepsilon
Last active February 19, 2017 13:35
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save nepsilon/bfcb4ccad69b0d35fdef7a5fc7be6a9a to your computer and use it in GitHub Desktop.
Save nepsilon/bfcb4ccad69b0d35fdef7a5fc7be6a9a to your computer and use it in GitHub Desktop.
3 Python modules you can use directly in the CLI — First published in fullweb.io issue #45

3 Python modules you can use directly on the CLI

1. 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

2. Start a local SMTP server to debug your app emails. Emails will be printed on stdout:

python -m smtpd -c DebuggingServer -n

3. 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