I am learning Python, and i get an error in following:
i already create a module hello.py in following:
then, i open new window of Python, and type import commands:
and just occur errors:
>>> import hello.py
Traceback (most recent call last):
File "<pyshell#0 >", line 1, in <module>
import hello.py
File "C:\Python27\li b\hello.py", line 1
Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
^
SyntaxError: invalid syntax
>>>
the question is what error, how i can fix it?
thanks!
i already create a module hello.py in following:
def print_func(par) :
print par
return
then, i open new window of Python, and type import commands:
import hello.pyand just occur errors:
>>> import hello.py
Traceback (most recent call last):
File "<pyshell#0 >", line 1, in <module>
import hello.py
File "C:\Python27\li b\hello.py", line 1
Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
^
SyntaxError: invalid syntax
>>>
the question is what error, how i can fix it?
thanks!
Comment