I've been trying to use subprocess for a while now, but can't get it to work when calling QGIS modules. Here's my script:
import subprocess call("processing.runalg('gdalogr:merge', [rasterin1,rasterin2],'false','false',5,rasterout)") No matter the input rasters I use (or how I write their paths: I assume they should contain / , not \ to separate folders), I always get this error :
Traceback (most recent call last): File "", line 1, in File "C:\OSGEO4~1\apps\Python27\lib\subprocess.py", line 711, in __init__ errread, errwrite) File "C:\OSGEO4~1\apps\Python27\lib\subprocess.py", line 948, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified I used gdalogr here (and it doesn't work), but could have used saga:module or grass:module I also note people use subprocess to run gdal (Use subprocess.call with gdalwrap) successfully, so why subprocessing the processing module would not work?
Any clues?
أكثر...
import subprocess call("processing.runalg('gdalogr:merge', [rasterin1,rasterin2],'false','false',5,rasterout)") No matter the input rasters I use (or how I write their paths: I assume they should contain / , not \ to separate folders), I always get this error :
Traceback (most recent call last): File "", line 1, in File "C:\OSGEO4~1\apps\Python27\lib\subprocess.py", line 711, in __init__ errread, errwrite) File "C:\OSGEO4~1\apps\Python27\lib\subprocess.py", line 948, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified I used gdalogr here (and it doesn't work), but could have used saga:module or grass:module I also note people use subprocess to run gdal (Use subprocess.call with gdalwrap) successfully, so why subprocessing the processing module would not work?
Any clues?
أكثر...