Stefan <br>Yes - It's just one line in my python file and I double-checked my quotes.<br>-David<br><br><div class="gmail_quote">On Mon, Feb 20, 2012 at 6:04 PM, Stefan Keller <span dir="ltr"><<a href="mailto:sfkeller@gmail.com">sfkeller@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">David<br>
<br>
Just to be sure: You did make one single line without line breaks from the mail?<br>
<div class="im"><br>
os.system('start "C:\Program Files<br>
(x86)\PostgreSQL\9.1\bin\pgsql2shp.exe" -f D:\testShapefile.shp -h<br>
localhost -u postgres -p 5432 test_db "SELECT * FROM<br>
myschema.testquery"')<br>
<br>
</div>-Stefan<br>
<br>
2012/2/20 David Quinn <<a href="mailto:daithiquinn@gmail.com">daithiquinn@gmail.com</a>>:<br>
<div class="HOEnZb"><div class="h5">> I did try that and got the following error message:<br>
><br>
> "Windows cannot find '-f'. Make sure that you typed the name correctly, and<br>
> then try again."<br>
><br>
><br>
> On Mon, Feb 20, 2012 at 5:49 PM, Paul Ramsey <<a href="mailto:pramsey@opengeo.org">pramsey@opengeo.org</a>> wrote:<br>
>><br>
>> Your quotes are misplaced, try<br>
>><br>
>> os.system('start "C:\Program Files (x86)\PostgreSQL\9.1\bin\pgsql2shp.exe"<br>
>> -f<br>
>> D:\testShapefile.shp -h localhost -u postgres -p 5432 test_db "SELECT *<br>
>> FROM<br>
>> myschema.testquery"')<br>
>><br>
>><br>
>> On Mon, Feb 20, 2012 at 2:24 PM, David Quinn <<a href="mailto:daithiquinn@gmail.com">daithiquinn@gmail.com</a>><br>
>> wrote:<br>
>> > I'm trying to call the pgsql2shp.exe function using python, as I would<br>
>> > like<br>
>> > to be able to loop through some tables. What I've tried doing is the<br>
>> > following:<br>
>> ><br>
>> > import os<br>
>> > os.system('start "C:\Program Files<br>
>> > (x86)\PostgreSQL\9.1\bin\pgsql2shp.exe -f<br>
>> > D:\testShapefile.shp -h localhost -u postgres -p 5432 test_db "SELECT *<br>
>> > FROM<br>
>> > myschema.testquery""')<br>
>> ><br>
>> > When I paste the line:<br>
>> ><br>
>> > C:\Program Files (x86)\PostgreSQL\9.1\bin\pgsql2shp.exe -f<br>
>> > D:\testShapefile.shp -h localhost -u postgres -p 5432 test_db "SELECT *<br>
>> > FROM<br>
>> > myschema.testquery"<br>
>> ><br>
>> > it produces a shapefile without a problem. However, my python script<br>
>> > flashes<br>
>> > open a CMD terminal, but it disappears before I see what is happening<br>
>> > and<br>
>> > does not produce any output. I'm using PostGIS 2.0, Windows 7, and<br>
>> > Python<br>
>> > 2.6.5.<br>
>> > If there is an alternative approach to python for this, I will happily<br>
>> > try<br>
>> > it out.<br>
>> ><br>
>> > (I hope this question is not too off-topic!)<br>
>> ><br>
>> > Thanks,<br>
>> > David<br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > postgis-users mailing list<br>
>> > <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
>> > <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
>> ><br>
>> _______________________________________________<br>
>> postgis-users mailing list<br>
>> <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
>> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br>