Skip to content
/ pylight Public

Command line utility for viewing code snippets and source code files with syntax-highlighting

Notifications You must be signed in to change notification settings

Soliez/pylight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pylight

Command line utility for viewing code snippets and source code files with syntax-highlighting

Installation

Before you get started, ensure you have Python 3.8 or later installed

Step 1: Clone this repository

git clone https://github.com/Soliez/pylight.git

Step 2: Run the install script

python3 pylight/install.py

Alternative Installations

Pylight is also available as a compiled binary. See the Releases page for more details.


Usage

All of the following example usages are valid

Reading input from a file

Invoking pylight with the -f flag instructs pylight to treat the second argument as a file path

pylight -f <path-to-source-code-file>

Reading input from a command line argument

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())"

Reading input from an interactive prompt

Invoking pylight with the -i flag instructs pylight to read the input from the user with an interactive prompt at runtime

pylight -i

Reading input from standard-in

Invoking 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 -

Example Output

$ pylight -f example.py
import requests

r = requests.get("https://jsonplaceholder.typicode.com/users")

print(r.json())

About

Command line utility for viewing code snippets and source code files with syntax-highlighting

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages