*1. No, not really. But then again, I wasn't extensively using all of the
python libraries. My belief was, when it came to Google AppEngine, the more
I relied on the Java libraries rather than Jython libraries for my scripts,
the better, due to the limitations of AppEngine.*
*2. I've seen that, and I personally don't know enough about the internals
to be able to even hazard a guess. I've drifted away from AppEngine
development as of late, primarily because of the limits that the AppEngine
had placed on my latest project, which has forced a rewrite to make it work
in a Glassfish v3 environment I built at home instead.
On Tue, Mar 30, 2010 at 5:41 AM, Tom Nichols <tmnichols@...> wrote:
> Cliff -- First off, I don't think I ever thanked you for this tip :)
> Second, I wanted to follow up because I think I've found an alternative:
> Properties post = new Properties();
> post.setProperty( "python.path", libZipLocation ); // e.g. WEB-INF/Lib.zip
> PythonInterpreter.initialize( System.getProperties(), post, new String
> Since PythonInterpreter.initialize is a static method, I call this
> once in the static initializer for my script execution servlet. This
> seems to pre-set a path for all instances of PythonInterpreter so I
> don't have to prepend the script source with the 'sys.path..." lines.
> I think this would work for the JSR-233 method as well, since I
> believe it's just a wrapper around the PythonInterpreter class.
> Two other questions:
> (1) have you noticed that you have to remove "file.encoding" from the
> Java System properties? I've found that if I don't some part of the
> Jython internals try to access a java.io class that they're not
> supposed to and it causes the GAE security manager to throw an
> (2) I get this message regarding class cacheing:
> *sys-package-mgr*: The java security manager isn't allowing access to
> the package cache dir,
> Any thoughts on how the cache could be revamped to work without the
> filesystem? I imagine it would help improve the interpreter's
> 2010/3/15 Cliff Hill <xlorep@...>:
> > Actually, AppEngine will let you do it, with some finagling.
> > Find your Jython "Lib" folder, and put the folder's contents into a
> zipfile (I called it "Lib.zip", original, maybe not, but effective).
> > Then find a place for it in your webapp's folder (I use
> war/WEB-INF/lib-python/Lib.zip for mine).
> > I then add the following lines at the beginning of my python script:
> > import sys
> > sys.path.insert(0, 'WEB-INF/lib-python/Lib.zip')
> > Then I can import the python library modules as normal.
> > I've used this both in a stand-aline jython web-app and an embedded
> (JSR-233) manner. The latter lets me attach those lines to the beginning of
> the script's string before I process the script for execution, which cleaned
> up my python scripts by removing otherwise extraneous lines of code from the
> scripts. For the former, I simply put those two lines into a .py script
> themselves and imported that instead.
> > On Mon, Mar 15, 2010 at 12:49 PM, Tom Nichols <tmnichols@...>
> >> So in working on my python web console, I've only just realized that
> >> all of the standard CPython modules that Jython supports actually
> >> exist as .py files that are loaded at runtime. This presents a
> >> potentially serious problem for me: AppEngine doesn't allow direct
> >> file access at runtime! I suspect the internals of Jython's import
> >> mechanism is looking for a .py file on the system path, which won't
> >> work at all in the Java AppEngine runtime. Now, if there's a way for
> >> those imports to be read from the classpath instead of the filesystem,
> >> then I'll be all set. If not, the project is somewhat hosed, as the
> >> inability to use virutally _any_ of the standard cpython libraries
> >> presents a considerable limitation to the project.
> >> Can Jython modules be loaded from the classpath??
> >> Any suggestions from the wise Jython project maintainers?
> >> Thanks.
> >> -Tom
> >> Download Intel® Parallel Studio Eval
> >> Try the new software tools for yourself. Speed compiling, find bugs
> >> proactively, and fine-tune applications for parallel performance.
> >> See why Intel Parallel Studio got high marks during beta.
> >> http://p.sf.net/sfu/intel-sw-dev
> >> _______________________________________________
> >> Jython-users mailing list
> >> Jython-users@...
> >> https://lists.sourceforge.net/lists/listinfo/jython-users
> > --
> > "I'm not responcabel fer my computer's spleling errnors" - Xlorep
> > Website: http://darkhelm.org
"I'm not responcabel fer my computer's spleling errnors" - Xlorep DarkHelm