Running external programs: what is the best way?

S

sir_alex

If i have to execute an external program (for example, in the frontend
that i created for convert, from ImageMagick) i have 2 possibilities: i
can call one function between the exec* family, or i can call the
system function: so, which in your opinion is the best? The only
difference that i know (but i may be in error) between these 2
functions is that the former doesn't return (so you have to create a
child process), but the latter returns. Is this the only difference?
 
P

Peter Hansen

sir_alex said:
If i have to execute an external program (for example, in the frontend
that i created for convert, from ImageMagick) i have 2 possibilities: i
can call one function between the exec* family, or i can call the
system function: so, which in your opinion is the best? The only
difference that i know (but i may be in error) between these 2
functions is that the former doesn't return (so you have to create a
child process), but the latter returns. Is this the only difference?

Those are options. So is the newer subprocess module, which I believe
is considered to be a reason to deprecate almost all other ways of doing
the same thing (os.system, possibly excluded, because of it's sheer
simplicity).

-Peter
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top