[python] -- interesting use of the webbrowser module

Discussion in 'Python' started by David Stockwell, Jun 10, 2004.

  1. In the ongoing endeavor to learn python I started playing with the
    webbrowser module.

    In this case I found an unorthodox way to launch an editor using the
    webbrowser.

    Instance x just uses lynx to open a website.

    instanze z however, opens an editor on a file. I'm sure there are other
    ways to do it, I just saw it as a slightly different way to do this.

    I guess what it really means is the 'open' simply launches the requested
    application and then that application does whatever it does.

    One thing I did notice is that the 2nd launch doesn't occur until the first
    has completed. which makes each of these operations synchronous in nature.
    (no kwrite until lynx has closed).

    code:
    ------------------ START CODE -----

    import webbrowser as wb

    x = wb.GenericBrowser('lynx %s')
    z = wb.GenericBrowser('kwrite %s')

    print "Opening instance X"
    x.open('cellphone.duneram.com')

    print "Opening instance Z"
    z.open('/tmp/xyzabc')
    ----------------- FIN DE CODE -------

    David
    -------
    Tracfone: http://cellphone.duneram.com/index.html

    _________________________________________________________________
    FREE pop-up blocking with the new MSN Toolbar – get it now!
    http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
     
    David Stockwell, Jun 10, 2004
    #1
    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. SPE - Stani's Python Editor

    Firefox bug in webbrowser module on Ubuntu?!

    SPE - Stani's Python Editor, Jan 20, 2006, in forum: Python
    Replies:
    5
    Views:
    422
    Jarek Zgoda
    Jan 22, 2006
  2. Blair P. Houghton
    Replies:
    19
    Views:
    524
    Blair P. Houghton
    Feb 2, 2006
  3. robin
    Replies:
    0
    Views:
    400
    robin
    May 18, 2006
  4. robin

    webbrowser module bug on os x?

    robin, May 25, 2006, in forum: Python
    Replies:
    0
    Views:
    229
    robin
    May 25, 2006
  5. Dustan
    Replies:
    8
    Views:
    405
    Dustan
    Sep 24, 2006
Loading...

Share This Page