[C++-sig] Importing and internal modules

Hans Meine meine at informatik.uni-hamburg.de
Thu Oct 2 13:34:08 CEST 2008

Am Montag, 29. September 2008 21:20:06 schrieb Peter LaDow:
> The scriptable part is a module.  It exposes a set of functions, so
> I'd really like to just import that module, and not execute it.  [...]

Maybe you misunderstand the difference between import and execfile.  importing 
is just some kind of namespaced execution; it is still execution.  Also, you 
can pass execfile dictionaries for the local and global namespaces which make 
it possible to customize both what's predefined in the script, as well as  
which namespace the functions defined in it end up in.

Ciao, /  /
    /  / ANS

More information about the Cplusplus-sig mailing list