![]() |
Webbrowser - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Webbrowser (/thread-29951.html) |
Webbrowser - jbrick97 - Sep-26-2020 New member here - Thanks in advance. I am using Sublime Text, wrote the below. Help me get this to open google! import webbrowser webbrowser.open("www.google.com") I saved this to my desktop as a python file. When I double click it, nothing happens. RE: Webbrowser - snippsat - Sep-26-2020 Use Code tags. (Sep-26-2020, 07:44 PM)jbrick97 Wrote: I saved this to my desktop as a python file. When I double click it, nothing happens.Do get used to run code from command line and not trough double click. Check python version then run file. # web_b.py import webbrowser webbrowser.open("www.google.com") E:\div_code\new λ python -V Python 3.8.3 E:\div_code\new λ python web_b.py E:\div_code\newI use cmder here same in cmd. So if no errors the only thing that's happens is that that it open googl.com in your default web-browser. RE: Webbrowser - jbrick97 - Sep-26-2020 I guess I'm not sure what you're saying here .. sorry RE: Webbrowser - ndc85430 - Sep-27-2020 The bottom line is: you need to tell the Python interpreter to run your program, which you do on the command line. What operating system are you running? Have you actually installed Python? If not, how do you expect to run Python programs? |