Python equivalent to PHP's SPL __autoload() ??

I

Ixiaus

I was curious (and have spent an enormous amount of time on Google
trying to answer it for myself) if Python has anything remotely
similar to PHP's SPL __autoload() for loading classes on the fly??

After digging through docs I feel doubtful there is such a language
feature, but, it is possible I missed something or maybe someone has
written an extension?!?

Thanks in advance!
 
I

ici

I was curious (and have spent an enormous amount of time on Google
trying to answer it for myself) if Python has anything remotely
similar to PHP's SPL __autoload() for loading classes on the fly??

After digging through docs I feel doubtful there is such a language
feature, but, it is possible I missed something or maybe someone has
written an extension?!?

Thanks in advance!

from module_name include *
Can do the magic. You can't learn Python from helps or internet, got a
book. Learning Python: http://www.oreilly.com/catalog/lpython/ is a
very good start :)
 
M

Max Erickson

Ixiaus said:
I was curious (and have spent an enormous amount of time on Google
trying to answer it for myself) if Python has anything remotely
similar to PHP's SPL __autoload() for loading classes on the fly??

After digging through docs I feel doubtful there is such a language
feature, but, it is possible I missed something or maybe someone has
written an extension?!?

Thanks in advance!

If I'm understanding __autoload() correctly, not in the box, but most
of what you need is built in, you just have to do a little work to use
it. See the "Loading and reloading modules" section on this page:

http://effbot.org/librarybook/builtin.htm


max
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top