I am using pythontex to execute python code in latex. Since I have a large python code, I am trying to import the code using pycode ("\pyc{import code}"). The latex and python codes compile fine, but no sensible output is produced.
A minimal working example is:
\documentclass{article}
\usepackage{pythontex}
\begin{document}
\pyc{import test}
\end{document}
Note that, test is a python file ("test.py"), which has the following content:
print("hi")
Any suggestion on this would be highly helpful. Thanks in advance.
pdflatex
-pythontex
-pdflatex
I get a PDF withhi
.\pyc
: "\pyc[<session>]<openingdelim><code><closing delim>
This command is used for executing but not typesetting<code>
. The suffixc
is an abbreviation ofcode
. If theprint
statement/function is used within<code>
, printed content will be included automatically so long as the packageautoprint
option is set to true (the default setting)."