Command line utility for viewing code snippets and source code files with syntax-highlighting
Before you get started, ensure you have Python 3.8 or later installed
git clone https://github.com/Soliez/pylight.gitpython3 pylight/install.pyPylight is also available as a compiled binary. See the Releases page for more details.
All of the following example usages are valid
Invoking pylight with the -f flag instructs pylight to treat the second argument as a file path
pylight -f <path-to-source-code-file>Invoking pylight with the -c flag instructs pylight to treat the second argument as code
pylight -c "import requests; r = requests.get('https://jsonplaceholder.typicode.com/users'); print(r.json())"Invoking pylight with the -i flag instructs pylight to read the input from the user with an interactive prompt at runtime
pylight -iInvoking pylight with the - flag instructs pylight to read the input from stdin
echo "import requests; r = requests.get('https://jsonplaceholder.typicode.com/users'); print(r.json())" | pylight -$ pylight -f example.pyimport requests
r = requests.get("https://jsonplaceholder.typicode.com/users")
print(r.json())