Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71862

Re: All-numeric script names and import

Date 2014-05-21 07:03 -0700
From Ethan Furman <ethan@stoneleaf.us>
Subject Re: All-numeric script names and import
References <CAPTjJmoadqpS0O-15We7xi7SzFCVxTFe1TU8hConcGZzxTRdcA@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.10197.1400683720.18130.python-list@python.org> (permalink)

Show all headers | View raw


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~

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: All-numeric script names and import Ethan Furman <ethan@stoneleaf.us> - 2014-05-21 07:03 -0700

csiph-web