From: Frederik De B. <fre...@pa...> - 2005-03-14 11:30:49
|
Hi, I am currently working on an open-source tool for programming 2D graphics. It is a learning environment where students can use an easy language (Python) to learn about programming and design. The current version is written in Python itself and works only on Mac OS X; the new version is written in Java and is cross-platform, using Jython as a scripting layer, which works great. There are some problems with chdir, however. For example, users can use the image() command with a path that is (normally) relative to the script file. In Python, I solved this by chdirring to the directory of the script, which is impossible in Jython; this breaks the open command as well, so users have to use absolute paths. Since I read in the FAQ that chdir can't be supported because of JVM restrictions, I was thinking of faking it. Chdir is actually more of a state command anyway, so you could catch all uses (in os, os.path and the open command) and "inject" the current working directory. I was wondering if there is interest to support this in Jython. I am willing to invest some time in finding out what exactly needs to be changed. Kind regards, Freeeeeeeeeeeeeeee |