Popen3-style os.execl?

Discussion in 'Python' started by Chris Green, May 18, 2004.

  1. Chris Green

    Chris Green Guest

    Hey folks,

    I'm whipping up a quick CGI to wrap a command line app and I was a bit
    suprised to not find a execl-like Popen3 style object. I don't want
    to bother with the shell interpreting metacharaters by constructing a
    command line.

    Basically, I want something that acts just like Popen3 but allows me
    to specify cmd as a path + args. Does something like this exist in
    the standard library? If not, it sounds like a good candidate...

    Cheers,
    Chris
    --
    Chris Green <>
    Don't use a big word where a diminutive one will suffice.
     
    Chris Green, May 18, 2004
    #1
    1. Advertising

  2. Chris Green

    Donn Cave Guest

    In article <>, Chris Green <>
    wrote:

    > Hey folks,
    >
    > I'm whipping up a quick CGI to wrap a command line app and I was a bit
    > suprised to not find a execl-like Popen3 style object. I don't want
    > to bother with the shell interpreting metacharaters by constructing a
    > command line.
    >
    > Basically, I want something that acts just like Popen3 but allows me
    > to specify cmd as a path + args. Does something like this exist in
    > the standard library? If not, it sounds like a good candidate...


    Did you try it? I think of Popen3 as something that
    acts just like you describe, but also accepts a command
    line. Not the best API, maybe.

    Donn Cave,
     
    Donn Cave, May 18, 2004
    #2
    1. Advertising

  3. Chris Green <> writes:

    > Hey folks,
    >
    > I'm whipping up a quick CGI to wrap a command line app and I was a bit
    > suprised to not find a execl-like Popen3 style object. I don't want
    > to bother with the shell interpreting metacharaters by constructing a
    > command line.
    >
    > Basically, I want something that acts just like Popen3 but allows me
    > to specify cmd as a path + args. Does something like this exist in
    > the standard library? If not, it sounds like a good candidate...


    Um. Can't you pass a list to the Popen3 constructor?

    Cheers,
    mwh

    --
    same software, different verbosity settings (this one goes to
    eleven) -- the effbot on the martellibot
     
    Michael Hudson, May 19, 2004
    #3
  4. Chris Green

    Chris Green Guest

    Michael Hudson <> writes:

    > Um. Can't you pass a list to the Popen3 constructor?


    Well, by golly ya can. Since cmd is only ever one argument in the
    docs, I've never known that you could do this.
    --
    Chris Green <>
    This is my signature. There are many like it but this one is mine.
     
    Chris Green, May 19, 2004
    #4
  5. Chris Green <> writes:

    > Michael Hudson <> writes:
    >
    > > Um. Can't you pass a list to the Popen3 constructor?

    >
    > Well, by golly ya can. Since cmd is only ever one argument in the
    > docs, I've never known that you could do this.


    Ah, uh, right: this isn't documented. I'm not sure why... as noted,
    it doesn't work on Windows, but then if you were talking about execl,
    you presumably aren't that concerned.

    Cheers,
    mwh

    --
    Reading Slashdot can [...] often be worse than useless, especially
    to young and budding programmers: it can give you exactly the wrong
    idea about the technical issues it raises.
    -- http://www.cs.washington.edu/homes/klee/misc/slashdot.html#reasons
     
    Michael Hudson, May 19, 2004
    #5
    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. PC

    pipe() dup2() fork() execl() select()

    PC, Aug 9, 2003, in forum: C Programming
    Replies:
    3
    Views:
    1,274
  2. python newbie

    execl difficulty

    python newbie, Dec 14, 2003, in forum: Python
    Replies:
    9
    Views:
    5,154
  3. Erik Johnson

    execl() and inheritied streams

    Erik Johnson, Sep 28, 2004, in forum: Python
    Replies:
    2
    Views:
    402
    Erik Johnson
    Sep 28, 2004
  4. shalombi

    Execl() in windows

    shalombi, Sep 23, 2005, in forum: C Programming
    Replies:
    1
    Views:
    726
    Keith Thompson
    Sep 24, 2005
  5. kisshug

    execl function

    kisshug, Dec 25, 2005, in forum: C Programming
    Replies:
    1
    Views:
    424
    Jack Klein
    Dec 25, 2005
Loading...

Share This Page