If you use a dot in the name (other than the .py part), the part following that dot should not start with a number. Thus, a name like
ex4.4.py
is not a good idea. Instead, use
ex4_4.py
or perhaps simply
ex44.py.
Also, don't begin your filenames with a number.
- Python gets confused if it is told to import a module with a name that violates this rule. If you try to import, e.g., some function from a module named ex4.4.py, you get this error message:
File "myprogram.py", line 1
from ex4.4 import somefunction
^
SyntaxError: invalid syntax
even though a program with the name ex4.4.py might work fine in itself. Other than that, make sure you give meaningful names to your programs so that you can easily find and reuse them.