I have a python script that i am trying to run in order to dump a postgres table and I noticed there is a pgsql2shp command in bash to perform this easily but I would like to incoperate the same command in a python script and also use parameter substitution. I thought the following would work but it hasn’t yielded any result. What is the equivalent of the this command in python
(pgsql2shp -f %s.shp -h localhost -p 5432 testdb "%s_%s")%(table,table,test)