Executing a system call

Discussion in 'Python' started by Jagarlamudi Jagadeesh, Mar 5, 2004.

  1. Hi All,

    There are so many ways to execute a system call like,
    getstatusoutput()

    os.system()

    fork()
    os.execvp()

    using popen

    Of all these, which is the best to use ( interms of speed and
    resources) ?

    --
    Jagadeesh Jagarlamudi
    Btech 3rd year student.
    IIIT - Hyd,
    Gachibouly, Hyderabad
     
    Jagarlamudi Jagadeesh, Mar 5, 2004
    #1
    1. Advertising

  2. Jagarlamudi Jagadeesh

    Jorgen Grahn Guest

    On Sat, 6 Mar 2004 00:06:14 +0530 (IST), Jagarlamudi Jagadeesh <> wrote:
    >
    >
    > Hi All,
    >
    > There are so many ways to execute a system call like,
    > getstatusoutput()
    >
    > os.system()
    >
    > fork()
    > os.execvp()
    >
    > using popen


    And also os.spawnv*(), which unlike fork/exec work on some non-Unixes.

    > Of all these, which is the best to use ( interms of speed and
    > resources) ?


    It depends ;-) Some of these go through the shell (which may give you features
    you want, or features you *don't* want). I'd say the resources wasted on
    executing a shell are almost always negligable; you should probably make a
    decision based on functionality instead.

    /Jorgen

    --
    // Jorgen Grahn <jgrahn@ ''If All Men Were Brothers,
    \X/ algonet.se> Would You Let One Marry Your Sister?''
     
    Jorgen Grahn, Mar 6, 2004
    #2
    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. Irmen de Jong
    Replies:
    2
    Views:
    444
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=
    Aug 12, 2003
  2. system call and library call

    , Aug 22, 2005, in forum: C Programming
    Replies:
    7
    Views:
    3,044
    Jonathan Bartlett
    Aug 23, 2005
  3. leoman730

    System call and library call

    leoman730, May 3, 2007, in forum: C++
    Replies:
    6
    Views:
    933
    Jim Langston
    May 6, 2007
  4. Rick King
    Replies:
    1
    Views:
    267
    Martin v. Löwis
    Jul 26, 2009
  5. Lew
    Replies:
    2
    Views:
    697
    Mike Schilling
    Sep 6, 2009
Loading...

Share This Page