The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Java Help
|
PythonInterpreter.initialize
Discuss PythonInterpreter.initialize in the Java Help forum on Dev Shed. PythonInterpreter.initialize Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

February 6th, 2004, 03:32 AM
|
|
Junior Member
|
|
Join Date: Feb 2004
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
PythonInterpreter.initialize
Hello,
We're working on a project using Java and Python. While executing PyInterpreter.initialize() we encountered some problems.
The code we are using looks like this:
import java.util.*;
import org.python.util.*;
import org.python.core.*;
public class SimpleEmbedded {
public static void main(String []args) throws PyException {
PythonInterpreter interp;
Properties props=new Properties();
props.setProperty("python.path","/home/kdg/jython-2.1/Lib");
PythonInterpreter.initialize(System.getProperties(),props,args);
interp = new PythonInterpreter();
}
}
This code generates the following error-message:
Exception in thread "main" java.lang.NullPointerException
at org.python.core.PyJavaClass.lookup(PyJavaClass.java:43)
at org.python.core.PyObject.<init>(PyObject.java:46)
at org.python.core.PySingleton.<init>(PySingleton.java:8)
at org.python.core.PyNone.<init>(PyNone.java:10)
at org.python.core.PySystemState.initStaticFields(PySystemState.java:396)
at org.python.core.PySystemState.initialize(PySystemState.java:375)
at org.python.core.PySystemState.initialize(PySystemState.java:348)
at org.python.util.PythonInterpreter.initialize(PythonInterpreter.java:40)
at SimpleEmbedded.main(SimpleEmbedded.java:16)
Can anyone help us ?
Thanks,
Ann Carpentier
Kenny Mees
|

February 6th, 2004, 05:46 AM
|
 |
Hello World :)
|
|
Join Date: Mar 2003
Location: Hull, UK
|
|
by Java and Python do you mean Jython? You might have more luck in the Java forum with this one  even if you are working with Pythons Core i dout many people here (me included) are qualifide to answer your question
If you like i can try moveing your thread for you?
Mark.
__________________
programming language development: www.netytan.com – Hula
|

February 6th, 2004, 07:21 AM
|
|
Junior Member
|
|
Join Date: Feb 2004
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
move message
Indeed, we do mean Jython.
Can you please move our thread to the appropriate location?
Thanks 
|

February 6th, 2004, 07:35 AM
|
 |
Hello World :)
|
|
Join Date: Mar 2003
Location: Hull, UK
|
|
|
Ok i've moves the tread to the Java forum, but there IS still a pointer to this thread in the Python forum so anyone who might be able to help can still see it!
Good luck with the project,
Mark.
|

February 6th, 2004, 08:23 AM
|
 |
Prom night: 1973
|
|
|
|
I've never used Jython, but this post suggests you make sure jython.jar is included in your classpath.
|

February 6th, 2004, 09:44 AM
|
 |
Hello World :)
|
|
Join Date: Mar 2003
Location: Hull, UK
|
|
Jython is an implementation of the Python programming language in pure Java... mmmm ok... not gonna mean anything to most of you since well  you're into Java not python but..
Quote:
Sean McGrath, CTO, Propylon
Jython, lest you do not know of it, is the most compelling weapon the Java platform has for its survival into the 21st century:-) |
Mark.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|