Interfacing with the command line

Discussion in 'Python' started by Byte, Mar 8, 2006.

  1. Byte

    Byte Guest

    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
    Byte, Mar 8, 2006
    #1
    1. Advertising

  2. Byte

    petrov Guest

    petrov, Mar 8, 2006
    #2
    1. Advertising

  3. Byte

    Byte Guest

    Exactly what I want. Thanks a mill!

    -- /usr/bin/byte
    Byte, Mar 8, 2006
    #3
  4. 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
    Terry Hancock, Mar 9, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lucas Cowald
    Replies:
    4
    Views:
    1,035
    Tohid
    Oct 23, 2003
  2. Bernd Oninger
    Replies:
    1
    Views:
    776
    Martin Honnen
    Jul 7, 2004
  3. Replies:
    4
    Views:
    1,696
    Terry Hancock
    Apr 23, 2005
  4. Lucas Cowald

    RUN/execute a Command-Line command from an ASP page

    Lucas Cowald, Oct 22, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    224
    Genich
    Oct 22, 2003
  5. Lucas Cowald

    RUN/execute a Command-Line command from an ASP page.

    Lucas Cowald, Oct 22, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    191
    Oliver
    Oct 22, 2003
Loading...

Share This Page