pyreport Tips and Tricks

Importing modules

If your script imports additional custom-made modules, you have to point pyreport to the directories where the modules are located. For example, if your module is in the same directory as your script, you have to add the current directory to the python path:

PYTHONPATH=.:$PYTHONPATH pyreport script.py

Alternatively, in your python script you can add the path to the sys.path variable. At top of your script add following lines:

import sys
sys.path.append(".")

Adding comments and LaTeX formula

You can easily add comment to your report: just add an additional line which starts with #!  characters. For example:

#! This is my pyreport comment

This string will be rendered as a formatted  text in your report.

Additionally, you can also add LaTeX formulas by prepending the LaTeX command string with #$. For example,

#$ This is \LaTeX formula: $E=mc^2$

Note that in this case you have to include a special option (-l) for pyreport when generating the report:

pyreport -l myscript.py