From: <da...@eg...> - 2002-11-12 01:34:42
|
Hi, I am wondering what python.path is used by the class generated by jythonc. In particular, I am interested because I am exec-ing imports as in the following test program: ---test.py import sys module_to_import = sys.argv[1] print "Importing module "+module_to_import exec "import "+module_to_import print "Imported module has value:", eval(module_to_import+'.value') --- If I have a "data" file such as: ---mod1.py value=1 --- Then from the commandline I get: % jython test.py mod1 Importing module mod1 Imported module has value: 1 However, I seem to be unable to produce this behavior after compiling using jythonc. I get an error like this: % jythonc -j importer.jar -c -d -a test.py % java -jar importer.jar mod1 Importing module mod1 Exception in thread "main" Traceback (innermost last): File ".../test.py", line 0, in main File "<string>", line 1, in ? ImportError: no module named mod1 I tried doing: % java -Dpython.path=. -jar importer.jar mod1 But this produces the same error. Any help would be appreciated, Thanks, daishi |