Restricting import file lookup for pyd, dll, ...

Gabriel Genellina gagsl-py at yahoo.com.ar
Thu Oct 19 23:16:39 EDT 2006


At Thursday 19/10/2006 23:19, Bernard Lebel wrote:

>I'm affraid this step has already been done. I was not being pedantic
>when I said "locations that don't make sense", I *really* meant it.
>You would have to see the Filemon log!

Python searches modules along the directories in sys.path - if you 
see it looking at w:\foo\bar\baz I bet that such directory is 
included there. Well, it might not be a directory but a zip file, or 
you might have installed some import hooks (have you?) but on the 
most common cases, a simple scan along sys.path is performed.

>Anyway, then is there a way to tell Python not to look for pyd/dll and
>others in certain locations? In locations were you expect not to have
>such files for example?

I'm not really sure, but I don't think it could be done.
The OS does a similar scan when looking for needed libraries at 
program startup. Are you sure that *this* behavior is what causes 
your slow startup? What OS/filesystem are you using? Are you loading 
your application across the network, using a file share, samba or 
something like that?


-- 
Gabriel Genellina
Softlab SRL 

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar



More information about the Python-list mailing list