New to python and I'm trying to save and import my first modules. When I go to import my first module which I've named convert.py I receive the following error:

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import convert
File "C:\Python27\convert.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

I guess my question is am I saving it wrong? Importing wrong?

I'm using IDLE as a text editor and when I'm done typing the module I go to save as ---> and save as file name: convert.py save as type: Python and text files (*.py. *.pyw, *.txt). When importing I'm simply typing ---> import convert.

7 Years
Discussion Span
Last Post by smohrchi
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.