[DB-SIG] Running shp2pgsql from Python

2007-07-30 Thread Ervin Ramonllari
Hello all, thank you for your answer. I resolve that problem in this way import os cmd='dir/sh2pgsql.exe ' + option + shpafile + ' > '+ sqlfile os.system(cmd) option - one of the options accepted by shp2pgsql, it can be ommited, by default is '-c' shpafile - full path of shape file sqlfile -

Re: [DB-SIG] Running shp2pgsql from Python

2007-07-28 Thread Robert Brewer
Ervin Ramonllari wrote: > import os > os.execv('mydir/shp2pgsql.exe', args) > > *args is a list of arguments, the same as I pass them using cmd.exe >From the docs on os.execv: "In either case, the arguments to the child process should start with the name of the command being run,

[DB-SIG] Running shp2pgsql from Python

2007-07-28 Thread Ervin Ramonllari
Hello all, I' trying to run PostGIS Loader (shp2pgsql) from python using the following syntax: import os os.execv('mydir/shp2pgsql.exe', args) *args is a list of arguments, the same as I pass them using cmd.exe Is it correct or I'm doing sth wrong because it runs but there is no result, no