From: Jeff A. <ja...@fa...> - 2019-06-28 20:02:13
|
I assume you tried this at an interactive prompt and it worked? As in Python generally, Jython looks for a module along sys.path. But as in CPython, sys.path varies somewhat with how you start the interpreter. In particular, sys.path might not contain '.', or the current working directory, where it does so interactively. If that's the problem, just insert it at the front of sys.path before your own import. Jeff Jeff Allen On 28/06/2019 12:29, Евгений Король wrote: > Hello. I use PythonInterpreter in Java to run Jython. How i can import > my modules in code? When i trying to run, i have ImportError: No > module named code1, but i does interp.exec(code); code from code1 > module before i run code with import: > import sys > from code1 import * > > for param in sys.argv: > print (param) > print('Hello, World type 2') > print(add(1, 2)) > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |