Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to import a module with spaces in the name

0 views
Skip to first unread message

Gregory Piñero

unread,
Feb 15, 2006, 4:36:41 PM2/15/06
to pytho...@python.org
Let's say I have a module named "Excellent Module.py"

How would I import that into a script? I'm guessing it will involve
the imp module somehow
(http://www.python.org/doc/2.4.2/lib/module-imp.html) but I didn't
figure it out.

----

And let's go ahead and pretend I have a good reason for doing this and
that I already know that spaces in module filenames should be avoided
at all costs!

Thanks,

--
Gregory Piñero
Chief Innovation Officer
Blended Technologies
(www.blendedtechnologies.com)

Farshid Lashkari

unread,
Feb 15, 2006, 4:53:20 PM2/15/06
to
Gregory Pińero wrote:
> Let's say I have a module named "Excellent Module.py"

ExcellentModule = __import__('Excellent Module')

-Farshid

Gregory Piñero

unread,
Feb 15, 2006, 7:29:40 PM2/15/06
to Farshid Lashkari, pytho...@python.org
Thanks, that did work!


On 2/15/06, Farshid Lashkari <lashk...@spamworldviz.com> wrote:

> --
> http://mail.python.org/mailman/listinfo/python-list

0 new messages