Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Executing a system call

Reply
Thread Tools

Executing a system call

 
 
Jagarlamudi Jagadeesh
Guest
Posts: n/a
 
      03-05-2004


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


 
Reply With Quote
 
 
 
 
Jorgen Grahn
Guest
Posts: n/a
 
      03-06-2004
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?''
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Executing diff.exe with System call Lew Java 2 09-06-2009 06:36 AM
uniicode and executing a process with subprocess.call, or os.system Rick King Python 1 07-26-2009 04:07 AM
System call and library call leoman730 C++ 6 05-06-2007 12:37 AM
system call and library call rahul8143@gmail.com C Programming 7 08-23-2005 01:24 PM
os.system('cd dir1 ... and executing next os.system command in that directory (dir1) Irmen de Jong Python 2 08-12-2003 12:43 PM



Advertisments