#include equivalent

Kragen Sitaker kragen at dnaco.net
Mon Apr 2 18:27:08 EDT 2001


In article <Pine.LNX.4.21.0104022225400.30480-100000 at cens.ioc.ee>,
Pearu Peterson  <pearu at cens.ioc.ee> wrote:
>On Mon, 2 Apr 2001, Doug Gorley wrote:
>> Is there a way to separate classes into separate files and have them
>> included at runtime, similar to the way header files are #include'ed in
>> C++?  
>
>Python function execfile("filename") should be exact equivalent to CPP
>#include "filename" directive.

Yes, but you shouldn't use it for that --- instead, use import.
-- 
<kragen at pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Perilous to all of us are the devices of an art deeper than we possess
ourselves.
       -- Gandalf the White [J.R.R. Tolkien, "The Two Towers", Bk 3, Ch. XI]




More information about the Python-list mailing list