how to run os.execv() to run command pslq dbname < gen.command

S

Sonu

hello all ,
i need to run psql from my py file,,
for that i am using : os.execv(path for psql ,['psql dbname <
gen.command'])
but its not working ..........

the command wht i want to run from this py file is :>>>psql dbname <
gen.command

where gen.command file contain some command to create csv file from
database

\o temp.csv
\a
\f ,
select * from temp

if u have any idea plz help me,,
 
S

Steve Holden

Sonu said:
hello all ,
i need to run psql from my py file,,
for that i am using : os.execv(path for psql ,['psql dbname <
gen.command'])
but its not working ..........
I want to watch my TV, but it's not working. Can you tell me how to fix
it? ...
the command wht i want to run from this py file is :>>>psql dbname <
gen.command

where gen.command file contain some command to create csv file from
database

\o temp.csv
\a
\f ,
select * from temp

if u have any idea plz help me,,
Perhaps you could post your code, and a copy of the error messages you
see when you run this program? That will give a much better idea of what
the problem is.

You do realise that the snippet you posted isn't even legal Python, right?

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------
 
A

Alex Popescu

I want to watch my TV, but it's not working. Can you tell me how to
fix it? ...

I can help you... but only with a couple of channels :).
i need to run psql from my py file,,
for that i am using : os.execv(path for psql ,['psql dbname <
gen.command'])
but its not working ..........

I assume the problem relies in the execution pathes, but as Steve has
mentioned: without further details nobody will be able to help you.

../alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top