How to import filenames with special characters?

Gary Herron gherron at islandtraining.com
Tue Jun 24 17:52:30 CEST 2008


inhahe wrote:
> How would I import a python file whose name contains characters like .'s or 
> !'s?
>
> Is there really _no_ way to do that?  I have to use plain jane letters and 
> numbers for everything?
>   

The import statement can't help you, but take a look at the __import__ 
builtin function and the standard module named "imp".

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




More information about the Python-list mailing list