Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #8824 > unrolled thread
| Started by | Stéphane Klein <stephane@harobed.org> |
|---|---|
| First post | 2011-07-05 15:47 +0200 |
| Last post | 2011-07-05 15:47 +0200 |
| 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.
Re: imp.find_module don't found my module but standard import statement can import this module… why ? Stéphane Klein <stephane@harobed.org> - 2011-07-05 15:47 +0200
| From | Stéphane Klein <stephane@harobed.org> |
|---|---|
| Date | 2011-07-05 15:47 +0200 |
| Subject | Re: imp.find_module don't found my module but standard import statement can import this module… why ? |
| Message-ID | <mailman.627.1309873646.1164.python-list@python.org> |
Le 05/07/2011 15:44, Eric Snow a écrit :
> On Tue, Jul 5, 2011 at 1:36 AM, Stéphane Klein<stephane@harobed.org> wrote:
>> Hi,
>>
>> I would like import some module dynamically.
>>
>
> To import a module dynamically, you can use the built-in __import__ function:
>
> module = __import__("js")
>
> Even better, use importlib's import_module, which is available in
> 2.7/3.2. A backport is available on PyPI.
>
> module = importlib.import_module("js")
>
Thanks !
It's work very well.
Regards,
Stephane
--
Stéphane Klein <stephane@harobed.org>
blog: http://stephane-klein.info
Twitter: http://twitter.com/klein_stephane
pro: http://www.is-webdesign.com
Back to top | Article view | comp.lang.python
csiph-web