2017-05-28 21:20:48 +00:00
|
|
|
# Python is a high-level programming language
|
|
|
|
# and python is a Python interpreter.
|
|
|
|
|
|
|
|
# Basic example of server with python
|
|
|
|
# Will start a Web Server in the current directory on port 8000
|
|
|
|
# go to http://127.0.0.1:8000
|
|
|
|
#
|
|
|
|
# Python v2.7
|
|
|
|
python -m SimpleHTTPServer
|
|
|
|
# Python 3
|
|
|
|
python -m http.server 8000
|
|
|
|
|
2020-02-22 03:38:15 +00:00
|
|
|
# SMTP-Server for debugging, messages will be discarded, and printed on STDOUT.
|
2017-05-28 21:20:48 +00:00
|
|
|
python -m smtpd -n -c DebuggingServer localhost:1025
|
|
|
|
|
2020-02-22 03:38:15 +00:00
|
|
|
# Pretty print a JSON
|
2017-05-28 21:20:48 +00:00
|
|
|
python -mjson.tool
|
|
|
|
|
2017-06-04 20:46:06 +00:00
|
|
|
# Zen of Python
|
|
|
|
# or just 'import this' in python
|
|
|
|
python -mthis
|
|
|
|
|
2017-05-28 21:20:48 +00:00
|
|
|
# See also:
|
|
|
|
# Python language cheat sheets at /python/
|
|
|
|
# list of pages: /python/:list
|
|
|
|
# learn python: /python/:learn
|
|
|
|
# search in pages: /python/~keyword
|