[Tex/LaTex] Embedding Python in LaTeX

python

As of today, what is the best package for embedding functional Python code in LaTeX? I've searched this site and others, which recommend the python, pythontex, and sympy packages, amongst others, but the information is somewhat dated. I want to know what users suggest as the best alternative now.

Best Answer

You might want to try out Pylatex (https://github.com/JelteF/PyLaTeX), the documentation is not the best you can find out there, but once you get a hang of it, it is pretty neat. Personally, I love the fact that you can do your analysis(using Python) and the the documentation of the analysis together. And as it always goes, do split your programs into lots of small functions to make your work easier!