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


Groups > comp.lang.python > #71862 > unrolled thread

Re: All-numeric script names and import

Started byEthan Furman <ethan@stoneleaf.us>
First post2014-05-21 07:03 -0700
Last post2014-05-21 07:03 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#71862 — Re: All-numeric script names and import

FromEthan Furman <ethan@stoneleaf.us>
Date2014-05-21 07:03 -0700
SubjectRe: All-numeric script names and import
Message-ID<mailman.10197.1400683720.18130.python-list@python.org>
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~

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web