[python] Ja prevest hierachickou jmeno modulu na cestu ve filesystem

regnarG regnarg na seznam.cz
Pátek Září 7 15:52:40 CEST 2007


Ondrej Beran napsal(a):
> 2007/9/7, Leos Pol <leos na radiante-corp.com>:
>   
>> Pokud to chapu dobre, tak imp.find_module je to prave orechove.
>>     
>
> To jsem taky nasel, ale nasledujici odstavec me odradil, protoze mi
> prislo sileny, ze bych mel pesky prolejzat namespacy. Tak jsem se
> zeptal, jestli neexistuje neco primocarejsiho.
>
> This function does not handle hierarchical module names (names
> containing   dots). In order to find P.M, that is, submodule M of
> package P, use find_module() and load_module() to find and load
> package P, and then use find_module() with the path argument set to
> P.__path__. When P itself has a dotted name, apply this recipe
> recursively.
>
> Protoze jestli tomu rozumim, tak stejne bych to musel postupne
> loadovat a to uz asi rovnou muzu pouzit ten
> __import__(name,........).__file__ a bude to aspon bez prace.
>
> Diky, Ondrej
> _______________________________________________
> Python mailing list
> Python na py.cz
> http://www.py.cz/mailman/listinfo/python
>
>   
Otázkou je, zda je vůbec technicky možno určit cestu k hierarchicky
importovanému modulu bez importování...

-- 

                                                  regnarG
http://regnarg.kx.cz



Další informace o konferenci Python