How to import module whose filename starts number

Yong Hu yhu221300 at gmail.com
Wed Dec 12 18:42:16 CET 2012


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?



More information about the Python-list mailing list