Sam
Sam

Reputation: 73

Command to make a Python application open a webpage

What would I have to do to make a Python application I am writing open up a web page in the default browser? It doesn't need to be told what the webpage is or anything, it'll be opening one that I've already chosen.

I found some documentation here but I always get a syntax error from the symbols in the URL. Any help?

Upvotes: 0

Views: 3926

Answers (2)

MRAB
MRAB

Reputation: 20654

Have a look at the webbrowser module.

Upvotes: 1

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798626

The URL needs to be in a string.

webbrowser.open('http://www.google.com/')

Upvotes: 6

Related Questions