A Python file in your LaTeX project
Python files are stored in the project alongside your .tex files, images, and data.
When you open a .py file, the editor switches to Python mode and a
Run button lets you execute the script directly.
import numpy as np import matplotlib.pyplot as plt x = np.linspace(-2, 2, 200) y = x ** 2 plt.plot(x, y) plt.savefig("plot.pdf")