All-numeric script names and import

Ethan Furman ethan at stoneleaf.us
Wed May 21 10:03:12 EDT 2014


On 05/21/2014 06:46 AM, Chris Angelico wrote:
>
> # from 1 import app as application # Doesn't work with a numeric name
> application = __import__("1").app

The statement form of import only works with valid Python identifiers.  So all numeric names won't work, names with 
dashes won't work, etc.

--
~Ethan~



More information about the Python-list mailing list