subprocess check_output und pdflatex unter Windows
Verfasst: Mittwoch 18. Dezember 2019, 18:39
Hallo Zusammen
ich versuche mit subprocess meinen pdflatex befehl auszuführen Mittels os.system("pfad + parameter") hat es funktioniert. Man bekommt jedoch nichts verwertbares wie Exitcodes o.Ä. zurück
nun habe ich Folgendes probiert
und bekomme leider nur folgendes zurück:
Also ich weiß also nicht, warum der Befehl fehlgeschlagen ist. Gibt es eine Möglichkeit, sich den Befehl ausgeben zu lassen, um zu prüfen, warum dieser fehlschlägt?
VG niesel
ich versuche mit subprocess meinen pdflatex befehl auszuführen Mittels os.system("pfad + parameter") hat es funktioniert. Man bekommt jedoch nichts verwertbares wie Exitcodes o.Ä. zurück
nun habe ich Folgendes probiert
Code: Alles auswählen
import subprocess
out=subprocess.check_output([ r'"C:\Users\niesel\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe"',
"-output-directory ",
"C:\\Users\\niesel\\Documents\\python\\pdflatex_subprocess\\",
"-synctex=1",
"-interaction=nonstopmode",
"C:\\Users\\niesel\\Documents\\python\\pdflatex_subprocess\\test.tex"],
shell=True,
stderr=subprocess.STDOUT)
Code: Alles auswählen
Traceback (most recent call last):
File "C:/Users/niesel/Documents/python/pdflatex_subprocess/createpdf.py", line 12, in <module>
stderr=subprocess.STDOUT)
File "C:\Users\niesel\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 395, in check_output
**kwargs).stdout
File "C:\Users\niesel\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['"C:\\Users\\niesel\\AppData\\Local\\Programs\\MiKTeX 2.9\\miktex\\bin\\x64\\pdflatex.exe"', '-output-directory ', 'C:\\Users\\niesel\\Documents\\python\\pdflatex_subprocess\\', '-synctex=1', '-interaction=nonstopmode', 'C:\\Users\\niesel\\Documents\\python\\pdflatex_subprocess\\test.tex']' returned non-zero exit status 1.
VG niesel