Pure Embedding

Alex Martelli aleax at aleax.it
Thu Mar 6 23:30:29 CET 2003


Khorne wrote:

>  Hello!
> 
> Can anyone tell me why *untouched* "pure embedding" example from
> python.org just does not work? The code can be found at
> http://www.python.org/doc/2.2.2/ext/pure-embedding.html
> 
> I wote the following script:
> 
> -script.py-
> 
> def func(a,b):
> return a+b
> 
> -end-
> 
> And I get:
> 
> [root at khorne python]# ./call ./script.py func 1 2
> ValueError: Empty module name
> Failed to load "./script.py"
> 
> WTF?

The example usage give in the URL you quote is:

$ call multiply 3 2

Hint: does the example usage give a path and extension?
Does your failing use attempt give them?

I think the example will probably also fail when used
as documented, because the current directory is not, by
default, in sys.path for embedded Python -- I just posted
about this and the solution[s] in another thread, just
a few hours ago, so please look my other post up for details.


Alex





More information about the Python-list mailing list