
私はLaTeXコード内でPythonコードを実行しようとしています。単純なhelloworldの例を試しましたが、このエラーが発生しました。私のLaTeXファイル名はpyinlt.texです。
エラー:
i can't find file 'pyinlt.py.out'
<to be read again>
\def
ソースファイル:
\documentclass{article}
\usepackage{python}
\begin{document}
Say hello Python:
\begin{python}
print r"Hello \LaTeX!"
\end{python}
\end{document}
答え1
python
環境には、デフォルトでは無効になっているいくつかの権限が必要です。コンパイルするには、-shell-escape
コンパイル時に以下を使用してそれらを有効にします。
latex -shell-escape pyinlt.tex