[Tutor] Code to open a website

mann kann mannkann5 at gmail.com
Sun Feb 10 02:00:32 CET 2013


Dear Jedi,

I wrote my first program but it doesn't open a website as I intended it to.
Please correct my mistake.

Sincerely,
Mann



def a():
    import urllib.request
    url = "http://www.google.com"
    response = urllib.request.urlopen(url)

g = input("Please enter y or n to go to youtube : ")
if g == "y":
    print("Opening the website")
    a()
else:
    print("kein website")
    exit()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130209/73fedcd3/attachment-0001.html>


More information about the Tutor mailing list