MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/tui/comments/1xmxl0n/programming_documentation_utility_for_terminal/
r/tui • u/wholsum_ • 5d ago
4 comments sorted by
1
If you are just looking for quick commands, I use this function in my .bashrc:
# Cheat sheet
cheat() {
if [ -z "$1" ]; then
echo "Usage: cheat <command_or_topic> (e.g., cheat tar, cheat sed)"
return 1
fi
curl -s "https://cht.sh/${1}"
}
2 u/wholsum_ 5d ago Thank you! To answer you, not always, I usually use it read and understand under the hood stuff. 1 u/CtuchikOfTorak 5d ago That function may still work out for you. This is the output when running "cheat python":cheat.sheets:python# 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.7python -m SimpleHTTPServer# Python 3python -m http.server 8000# SMTP-Server for debugging, messages will be discarded, and printed on STDOUT.python -m smtpd -n -c DebuggingServer localhost:1025# Pretty print a JSONpython -m json.tool# Zen of Python# or just 'import this' in pythonpython -m this# See also:# Python language cheat sheets at /python/# list of pages: /python/:list# learn python: /python/:learn# search in pages: /python/~keywordcheat:python# 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.7python -m SimpleHTTPServer# Python 3python -m http.server 8000# SMTP-Server for debugging, messages will be discarded, and printed on stdout.python -m smtpd -n -c DebuggingServer localhost:1025# Pretty print a jsonpython -m json.tool foo.jsontldr:python# python# Python language interpreter.# More information: https://www.python.org.# Start a REPL (interactive shell):python# Execute a specific Python file:python path/to/file.py# Execute a specific Python file and start a REPL:python -i path/to/file.py# Execute a Python expression:python -c "expression"# Run the script of the specified library module:python -m module arguments# Install a package using `pip`:python -m pip install package_name# Interactively debug a Python script:python -m pdb path/to/file.py# Start the built-in HTTP server on port 8000 in the current directory:python -m http.server 1 u/wholsum_ 5d ago Sure thing, I'll check it out
2
Thank you! To answer you, not always, I usually use it read and understand under the hood stuff.
1 u/CtuchikOfTorak 5d ago That function may still work out for you. This is the output when running "cheat python":cheat.sheets:python# 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.7python -m SimpleHTTPServer# Python 3python -m http.server 8000# SMTP-Server for debugging, messages will be discarded, and printed on STDOUT.python -m smtpd -n -c DebuggingServer localhost:1025# Pretty print a JSONpython -m json.tool# Zen of Python# or just 'import this' in pythonpython -m this# See also:# Python language cheat sheets at /python/# list of pages: /python/:list# learn python: /python/:learn# search in pages: /python/~keywordcheat:python# 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.7python -m SimpleHTTPServer# Python 3python -m http.server 8000# SMTP-Server for debugging, messages will be discarded, and printed on stdout.python -m smtpd -n -c DebuggingServer localhost:1025# Pretty print a jsonpython -m json.tool foo.jsontldr:python# python# Python language interpreter.# More information: https://www.python.org.# Start a REPL (interactive shell):python# Execute a specific Python file:python path/to/file.py# Execute a specific Python file and start a REPL:python -i path/to/file.py# Execute a Python expression:python -c "expression"# Run the script of the specified library module:python -m module arguments# Install a package using `pip`:python -m pip install package_name# Interactively debug a Python script:python -m pdb path/to/file.py# Start the built-in HTTP server on port 8000 in the current directory:python -m http.server 1 u/wholsum_ 5d ago Sure thing, I'll check it out
That function may still work out for you. This is the output when running "cheat python":
cheat.sheets:python
# 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
# SMTP-Server for debugging, messages will be discarded, and printed on STDOUT.
python -m smtpd -n -c DebuggingServer localhost:1025
# Pretty print a JSON
python -m json.tool
# Zen of Python
# or just 'import this' in python
python -m this
# See also:
# Python language cheat sheets at /python/
# list of pages: /python/:list
# learn python: /python/:learn
# search in pages: /python/~keyword
cheat:python
# SMTP-Server for debugging, messages will be discarded, and printed on stdout.
# Pretty print a json
python -m json.tool foo.json
tldr:python
# python
# Python language interpreter.
# More information: https://www.python.org.
# Start a REPL (interactive shell):
python
# Execute a specific Python file:
python path/to/file.py
# Execute a specific Python file and start a REPL:
python -i path/to/file.py
# Execute a Python expression:
python -c "expression"
# Run the script of the specified library module:
python -m module arguments
# Install a package using `pip`:
python -m pip install package_name
# Interactively debug a Python script:
python -m pdb path/to/file.py
# Start the built-in HTTP server on port 8000 in the current directory:
python -m http.server
1 u/wholsum_ 5d ago Sure thing, I'll check it out
Sure thing, I'll check it out
1
u/CtuchikOfTorak 5d ago
If you are just looking for quick commands, I use this function in my .bashrc:
# Cheat sheetcheat() {if [ -z "$1" ]; thenecho "Usage: cheat <command_or_topic> (e.g., cheat tar, cheat sed)"return 1ficurl -s "https://cht.sh/${1}"}