I have a very simple python script that used os.system to run a GDAL command. It is -> list target files -> loop them -> try os.system gdal_translate command. In the past I simply had a line towards the top of the script that was
sys.path.append(r"C:\OSGeo4w\bin")
My os.system command was
os.system("gdal_translate -of GTiff "+fullPFD+" "+fullNewName+" "+"-co COMPRESS=NONE --config GDAL_PDF_DPI "+res)
Where fullPDF
is the full path to the target PDF, fullNewName
is the same thing with '.tif' substituted for '.pdf' and res
is the resolution I want.
This worked in the past. Now when I run the script, no command prompt is launched. The code doesn't break and the print commands located around the os.system are used. The code is simply not running the os.system gdal command.
- Please avoid discussing direct GDAL modules in Python IDE. I have been down that path unsuccessfully. I need a quick answer, which was
os.system
. - Other things to note are that since I ran this script last year, I have installed 2 more python versions, (Although I don't think that is the culprit.)