469,304 Members | 2,192 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,304 developers. It's quick & easy.

doing non-prespecified imports

Is it possible to do:

import xxxx

within code where xxxx is specified by
a string or user input?
I need this in order to be able to load different,
arbitrary modules under application-user control.

If not using the 'import xxxx' syntax, is there
a roundabout way to do such?
Jul 18 '05 #1
1 1093
On Sat, Jul 31, 2004 at 08:32:14AM +0800, Jon Perez wrote:
Is it possible to do:

import xxxx

within code where xxxx is specified by
a string or user input?
I need this in order to be able to load different,
arbitrary modules under application-user control.

See the built-in function __import__()
egbert
--
Egbert Bouwman - Keizersgracht 197 II - 1016 DS Amsterdam - 020 6257991
================================================== ======================
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Lee, Dustin | last post: by
28 posts views Thread by fred.haab | last post: by
9 posts views Thread by Cao Yi | last post: by
16 posts views Thread by SirG | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.