I am just a beginner in Python. I created a file called as cc.py
and saved in the following path :
C:/Python33/cc.py
.
I am trying to run this file but nothing is happening.
In the python shell I am typing Python cc.py
but I am getting the following error:
SyntaxError: invalid syntax
I tried an alternative :
>>> execfile('cc.py');
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
execfile('cc.py');
NameError: name 'execfile' is not defined
The file contains the following lines of code :
import urllib
htmlfile = urllib.urlopen("http://google.com")
htmltext = htmlfile.read()
print htmltext
How should I run this file? I am totally confused. Can someone help me out?