473,395 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Interfacing with the command line

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

Mar 8 '06 #1
3 1132
http://effbot.org/librarybook/os.htm

scroll down about half a page to example 8.
is that what you're looking for?

PV

Mar 8 '06 #2
Exactly what I want. Thanks a mill!

-- /usr/bin/byte

Mar 8 '06 #3
On Wednesday 08 March 2006 09:35 am, Byte wrote:
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

--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks http://www.anansispaceworks.com
Mar 9 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Shaurya Anand | last post by:
I would like to know more about Interfacing hardware devices through .NET. We're students and what we're trying to do is control our robots with printer or serial port interfacing... very similar...
7
by: adsheehan | last post by:
Hi, I am embedding Python with a C++ app and need to provide the Python world with access to objects & data with the C++ world. I am aware or SWIG, BOOST, SIP. Are there more? I welcome...
3
by: Cherry | last post by:
I have an ID Innovation card reader that I am trying to connect to my Access database. The first problem is that when I swipe the card through the reader, it reads the id but it adds digits to the...
3
by: Kevin | last post by:
Hi All I got some good responses from some of you guys regarding me serial port interfacing problem that I posted a little while back. However your help leaded me to this link belo ...
2
by: abhay | last post by:
hi,i m interfacing gsm modem to my microcontroller.i need to send sms through it. i am using AT commands for that.the command to send sms (AT+ CMGS) terminates with ctrl-Z.now in my program i hav...
14
by: nsamad | last post by:
Hi All, Is there anyone using python script to programm the Telit GM862-GPS module?? I am a newbie in using python. I am developing an application in which i have to open a GPRS connection and...
7
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi I have a windows app that users use as a standalone product but some want to embed the functionality into there system. Basically they want a gateway to call my form or forms with parameters...
5
by: Anonymous | last post by:
I am trying something which appears (so far), that many other people have not yet tried before - since I can't find any useful related material despite several days of searching various sites/blogs...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.