Subprocess in Python

Discussion in 'Python' started by unni krishnan.r, Oct 19, 2022.

  1. unni krishnan.r

    unni krishnan.r Member

    Joined:
    Apr 20, 2010
    Messages:
    209
    Likes Received:
    4
    Trophy Points:
    18
    Occupation:
    education
    Location:
    Kerala
    Home Page:
    http://blogofunni.blogspot.com
    As part of a process I need to run a command involving gdal, the code is attached above.

    Code:
    pcall= "gdal_grid  --config 'NUM_THREADS=ALL_CPUS GDAL_CACHEMAX=2000'\
           -overwrite -a invdist:power=2.0:smoothing=2.0:radius1=360.0:radius2=360.0\
           -ot UInt16 -of GTiff -outsize %d %d -l %s -zfield 'Z' %s %s "%(npx, npy,\
           lname,ptshapefile,interprasterfile)
    
    subprocess.call(pcall, shell= True)
    What changes need to be done so that the same works for Windows
     
    shabbir likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice