-1

So I have a python script calling some other pythons scripts in the working directory. I usually use naming conventions like v1.0.3_ModuleName.py to keep track of newer versus older versions of my script. When I tried to import my module:

import v1.0.3_ModuleName

I recieved the good ole: SyntaxError: invalid syntax error. Now I realized my error quickly and took out the periods.

This make me wonder, what other file names with result in errors when you try to import them into python?

Cody Brown
  • 1,409
  • 2
  • 15
  • 19

1 Answers1

0

If you're using linux you could make a symbolic link to your module that doesn't include dots and numbers :) But this isn't a portable solution.

More about module naming.

Community
  • 1
  • 1
nio
  • 5,141
  • 2
  • 24
  • 35