import help

Gary Herron gherron at islandtraining.com
Tue Aug 8 02:32:01 EDT 2006


placid wrote:
> Hi all,
>
> How do i import a module that has an hypen/dash (-) in its name ? I get
> a SytaxError exception
>
> Cheers
>
>   
You can't do that directly. However, the internals of the import 
mechanism are available to the programmer through a module named imp. It 
allows you to import a file whose name is specified in a string -- that 
should work for you.

Gary Herron




More information about the Python-list mailing list