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

Discussion in 'Python' started by Sonu, Aug 4, 2007.

  1. Sonu

    Sonu Guest

    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,,
    Sonu, Aug 4, 2007
    #1
    1. Advertising

  2. Sonu

    Steve Holden Guest

    Sonu wrote:
    > 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 -------------
    Steve Holden, Aug 4, 2007
    #2
    1. Advertising

  3. Sonu

    Alex Popescu Guest

    Steve Holden <> wrote in
    news:f91uju$130$:

    > Sonu wrote:
    >> hello all ,
    >>

    > 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
    --
    ..w( the_mindstorm )p.
    Alex Popescu, Aug 5, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. M Herriott
    Replies:
    3
    Views:
    1,688
    M Herriott
    Feb 26, 2004
  2. Matt MacDonald
    Replies:
    0
    Views:
    799
    Matt MacDonald
    Jun 14, 2007
  3. Replies:
    1
    Views:
    295
    Diez B. Roggisch
    Aug 29, 2008
  4. R. Bernstein
    Replies:
    2
    Views:
    504
    R. Bernstein
    Jan 29, 2009
  5. Max
    Replies:
    0
    Views:
    393
Loading...

Share This Page