Ich habe mir ein kleines Programm erstellt, das ein Pdf erstellt.
Am Ende soll das Script das neue Pdf mit dem Adobe Reader (Win10) ausführen...
Nur die Frage ist : " Wie geht das?"
Gefunden habe ich folgendes :
import subprocess
# Replace the file and location with the file you want to run.
subprocess.Popen(r"C:\Windows\explorer.exe")
Das ganze ist hardcodiert. OK, aber funzt.
Ich bekomme mein PDF C:\temp\xyz.pdf da nicht als Variable 'rein.
Weiß einer , was ich da falsch mache ?
Norbert
Pdf erstellt und wie wird das Pdf gestartet
Wenn man unter Windows das Standardprogramm öffnen will, benutzt man `start`:
Code: Alles auswählen
pdffilename = "C:/temp/xyz.pdf"
subprocess.run(["start", pdffilename], shell=True)