I am trying to implement a function in my Python script to compile a TeX file automatically. I am trying with the subprocess module; this is what I'm doing:
def createpdf(output):
args = ['pdflatex', output, '-interaction=nonstopmode']
process = subprocess.call(args,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE,
stdin = subprocess.PIPE)
When I run pdflatex with my TeX file in the terminal, it compiles fine. But when I run my Python script, it doesn't compile. It seems like the compile process begins but after a couple of minutes, it stops without any reason. I looked in the log file and it doesn't print any error message.