From: Samuele P. <pe...@in...> - 2002-02-28 05:47:49
|
You have encountered a bug, a workaround is to define a startup.py: import TopLevel.mainmodule and then jythonc --core --deep --jar whatever.jar startup.py but depending our needs this can be useful or not. Let us know. regards, Samuele Pedroni. ----- Original Message ----- From: Bill Janssen <bi...@ja...> To: <jyt...@li...> Sent: Thursday, February 28, 2002 4:17 AM Subject: [Jython-users] freezing an application with pythonc? Do Python packages work? > I've got a fairly large Python application working with Jython, and > I'd like to generate a jar file so that the application could be run > with a command-line like > > java -classpath myjarfile.jar TopLevel.mainmodule > > This looks pretty easy to do with jythonc, and I've gotten it to work > on some simple examples. However my large app does things like > > import TopLevel > > from inside TopLevel.mainmodule. And that doesn't work; I get an > import error. I see that the documentation page for jythonc has some > unfinished sections at the bottom, where it says: > > > Freezing modules > > jythonc can also be used to freeze a python application. The frozen > application can then be distributed and deployed as any other java > application. > > Some diffrences between an interpreted application and a frozen > application exists: > > Properties are diffrent. XXX > sys.argv[0] > loading of python classes. > > > Anyone know the specifics of those differences? I suspect my troubles > are coming from "loading of python classes". In particular, I notice > that if TopLevel contains an __init__.py file, the import fails, but > if there's no such module, the import succeeds. > > Bill > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |