Thursday, September 1, 2011

pygmentize

Install pygmentize by

sudo easy_install Pygments

quick start (copied from the official Web site)



You can use Pygments from the command line, using the pygmentize script:
$ pygmentize test.py
will highlight the Python file test.py using ANSI escape sequences (a.k.a. terminal colors) and print the result to standard output.
To output HTML, use the -f option:
$ pygmentize -f html -o test.html test.py
to write an HTML-highlighted version of test.py to the file test.html. Note that it will only be a snippet of HTML, if you want a full HTML document, use the "full" option:
$ pygmentize -f html -O full -o test.html test.py
This will produce a full HTML document with included stylesheet.
A style can be selected with -O style=.
If you need a stylesheet for an existing HTML file using Pygments CSS classes, it can be created with:
$ pygmentize -S default -f html > style.css

No comments:

Post a Comment

Continuously monitor GPU usage

 For nvidia GPUs do the follwing: nvidia-smi -l 1