Yong Hu wrote: > I have a few scripts whose file names start with numbers. For example, > 01_step1.py, 02_step2.py > > I tried to import them in another script by "import 01_step1" or "from > 01_step1 import *". Both failed, saying "SyntaxError: invalid syntax" > > Is there anyway to import those files? The file name must start with > characters?
Or an underscore. The module name must be a valid identifier. In CPython you can hack around that restriction with step01 = __import__("01_step1") but this "solution" is not portable and I recommend that you rename your scripts instead. -- http://mail.python.org/mailman/listinfo/python-list