Interfacing with the command line

B

Byte

I know its possible to acsess Python via the command line, but can I do
the opposite and acsess the command line via Python? For example, can I
write a script that will enter

$ firefox

on the command line, opening Firefox for me?

Thanks in advance,
-- /usr/bin/byte
 
T

Terry Hancock

I know its possible to acsess Python via the command line, but can I do
the opposite and acsess the command line via Python? For example, can I
write a script that will enter

$ firefox

on the command line, opening Firefox for me?

You have several options, depending on how you want
to communicate with it, and what version of Python
you are using. Keywords:

os.system
popen
subprocess

Search the Library Reference.

Cheers,
Terry
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top