Computer Science Canada Jython execFile SyntaxError issue |
Author: | DemonWasp [ Sun Dec 19, 2010 6:44 pm ] | ||||||||||||
Post subject: | Jython execFile SyntaxError issue | ||||||||||||
I wasn't sure whether this belongs in Java Help or Python Help, but figured it's mostly Java. I'm using Jython (2.5.2rc2), trying to execute code stored in a file, extend.py. The contents of extend.py are pretty trivial:
The code I'm using to invoke that looks like the following: Initialization:
Approach 1 (does NOT work): This approach invokes execfile() on the source file's InputStream
Results:
Approach 2 (does work): This approach reads the code from the file into a StringBuilder, then invokes exec() on the assembled String.
Results:
I've tried googling the error message with a few different combinations of keywords, all to no avail. I don't know if I'm doing something stupid here, or if I'm running into some sort of bizarre bug. Has anyone run into similar issues with Jython before? |
Author: | DemonWasp [ Tue Dec 21, 2010 1:01 am ] |
Post subject: | RE:Jython execFile SyntaxError issue |
So...I'm not sure what I did, but something fixed it. Maybe it was just a random glitch...? |