#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    30
    Rep Power
    2

    Webbrowser module question


    I have only been doing Python for 3 months and the simple fact is that some people can learn things faster than other people, I'm a slower learner lol.

    My question is regarding the webbrowser module. I am using Python version 2.6.2 on Android OS. I'm just trying to open up a webpage on the system's default browser by using this:

    Code:
     
    import webbrowser
    
    web browser.open_new('www.google.com')
    and instead of it launching the browser it will say False. The same applies if I use open('www.google.com', new=0, autoraise=1)

    Please explain this to me
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,897
    Rep Power
    481
    After you've

    import webbrowser
    webbrowser.open_new('http://www.google.com')


    Now look at your web browser window.
    On google chrome a new window opened!
    Works for me.
    Current ubuntu linux release.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    30
    Rep Power
    2
    Originally Posted by b49P23TIvg
    After you've

    import webbrowser
    webbrowser.open_new('http://www.google.com')


    Now look at your web browser window.
    On google chrome a new window opened!
    Works for me.
    Current ubuntu linux release.
    Thanks for the reply I did try using the entire URL and the same results happened. If I run a script already made, nothing happens.....nothing gets opened on any browser. If I run the code from the interpreter it does this:
    Code:
    >>>import webbrowser
    >>>webbrowser.open('http://www.google.com')
    False
    >>>
    Maybe the webbrowser module on Android is messed up? I remember reading that all the modules weren't 100% functional

    For now I think I'll just keep working with CLI scripts until I am more familiar with the fascinating language.

IMN logo majestic logo threadwatch logo seochat tools logo