library to launch program in linux

I

idzwan.nizam

Hi there,

I'm a new user. What library should I use so that I can launch program
in linux using python? Thank you in advance.
 
L

Laszlo Nagy

Grant said:
subprocess
Hmm, there are some others. Here is a list:

os.system
os.popen (and os.popen2, os.popen3)
os.spawn
popen2 (the module)
subprocess (this is often preferred over other modules)

If you need to communicate with a subprocess using the system console,
then possibly the third party pexpect module worth look at it.

If you need to use this on Windows then you can use the win32 extensions
and "CreateProcess"...

I suggest that you read their documentation. Some of them are easy to
use but feature less. Others are good for some purpose.

Laszlo


p.s.: In Python "there should be only one obvious and correct way to do
it". What??? :)
 
I

idzwan.nizam

subprocess

can you please show me the sample code using subprocess library. I
would like user to have few option, program they could run. say,
firefox and x chat. thank you
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top