From: Lloyd S. <lso...@li...> - 2004-03-03 20:23:38
|
[This may get double posted, I first tried to post it before subscribing to list --sorry] Hey, I teach programming at the high school level and we're using python. A local university is hosting a programming contest where the acceptable languages are VB, java and C++. We don't know any of those languages, but the university is still interested in having us participate even if we can't "compete" in the contest. I was wondering if it is possible to use jythonc to compile our python programs which we could then submit to the normal contest judging program in the same manner the "normal" java contestants do. The programs are all of the form: read a datafile, process the data, write an outputfile. So this is the python program I am experimenting with: #test.py def main(): file = open('temp.txt','w') file.write('This is a test') file.close main() Here's what I've done so far (but let me preface this by saying that Jython AND Java are brand new to me, and I'll be leaving out the obviously stupid things I tried so as to make me look smarter). 0) this is under windows XP 1) I downloaded jython, then the sun J2 SDK 2) edited the jython registry file to include the path to javac 3) tried to figure-out from http://www.jython.org/docs/jythonc.html what I needed for options. This wasn't very successful, as I don't know enough about java, but it looked to me like I needed to compile to .class files and so it looked to me like -a -d or -c should work. 4) everything seemed to compile correctly, and when I look in /jpywork I see these three files: test.class test.java test$PyInner.class when I try to run either of the .class files from the command line with: c:/program files/jython21/jpywork>java test.class I get: Exception in thread "main" java.lang.NoClassDefFoundError: org/python/core/PyObject At this point I'm stuck. Can anyone point out what I should be doing instead? Lloyd Sommerer |