On 21 February 2012 13:39, David Quinn <daithiqu...@gmail.com> wrote: > Thanks for the link, Stefan. After testing out a few approaches this worked: > > import subprocess > subprocess.call(['C:/Program Files (x86)/PostgreSQL/9.1/bin/pgsql2shp.exe', > '-f', 'D:\testShapefile.shp', '-h localhost', '-u postgres', '-p 5434', > 'test_db', 'SELECT * FROM myschema.testquery'])
Watch out for the escaping for Windows paths. You should have one of these: 'D:\\testShapefile.shp' r'D:\testShapefile.shp' (I prefer this method) 'D:/testShapefile.shp' (I think this works) As you have it, it will be "D:[tab]estShapefile.shp" with the tab character. I don't think you are allowed to have a tab character in Windows path names, but I'm not sure. -Mike _______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users