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


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

Re: Importing two modules of same name

Started byTim Johnson <tim@akwebsoft.com>
First post2016-02-10 10:26 -0900
Last post2016-02-10 10:26 -0900
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: Importing two modules of same name Tim Johnson <tim@akwebsoft.com> - 2016-02-10 10:26 -0900

#102770 — Re: Importing two modules of same name

FromTim Johnson <tim@akwebsoft.com>
Date2016-02-10 10:26 -0900
SubjectRe: Importing two modules of same name
Message-ID<mailman.19.1455132411.22075.python-list@python.org>
* dieter <dieter@handshake.de> [160209 23:03]:
> Carl Meyer <carl@oddbird.net> writes:
> > ...
> > If you omit the future-import in Python 2.7, `import config` will import
> > the neighboring app/config.py by default, and there is no way to import
> > the top-level config.py.
> 
> There is the "__import__" builtin function which allows to specify
> the "parent package" indirectly via its "globals" parameter. This
> way, you can import the "top-level" config (passing an empty "globals").
  Thanks.
  I used __import__ as part of a custom load() function that I used
  in my own framework when I was developing CGI sites. I never used
  the globals parameter tho'.
  If I start

-- 
Tim 
http://www.akwebsoft.com, http://www.tj49.com

[toc] | [standalone]


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


csiph-web