Questions tagged [jython]

Jython is an open-source implementation of the Python programming language in Java. Use this tag for questions specific to this implementation, general Python questions should just be tagged with "python".

Jython is an open-source implementation of the Python programming language written in Java. It is seamlessly integrated with Java, in that it can import and use any Java class. Jython is extensively used as a official scripting language for all WebLogic Server administration tasks.

Jython is also used for administrative scripting for IBM's WebSphere Application Server through the Wsadmin client.

Helpful References

2784 questions
6
votes
2 answers

How do I catch SocketExceptions in MonkeyRunner?

When using MonkeyRunner, every so often I get an error like: 120830 18:39:32.755:S [MainThread] [com.android.chimpchat.adb.AdbChimpDevice] Unable to get variable: display.density 120830 18:39:32.755:S [MainThread]…
Dean
  • 8,632
  • 6
  • 45
  • 61
6
votes
1 answer

How could I use Jython threads as they were Java threads?

For example I want to reproduce this Thread in Jython because I need to start my statemachine from a Java API.I dont own much knowledge in Jython. How can I do that? Thread thread = new Thread() { @Override public void run() { …
hudsonsferreira
  • 207
  • 2
  • 13
6
votes
2 answers

Is Jython faster than Python?

I'm trying to get a little program to send hex over RS232. From what I've seen Python is a very good language to do this with. I learned it 3 years ago in an into to compsci course as a freshman in high school, and the syntax is amazing. It's…
Sponge Bob
  • 1,551
  • 5
  • 17
  • 23
6
votes
2 answers

Jython - is it faster to use Python data structures or Java ones?

I'm trying to understand whether and under what circs one should use Python classes and/or Java ones. If making a specialist dictionary/Map kind of class, should one subclass from Python's dict, or from Java's HashMap or TreeMap, etc.? It is…
mike rodent
  • 14,126
  • 11
  • 103
  • 157
6
votes
1 answer

What is the best way to use python code from Scala (or Java)?

Possible Duplicate: Java Python Integration There is some code written in Python and I need to use it from Scala. The code uses some native C. Is it possible to use this from Scala or Java without having to rewrite much? I intend to use the code…
Jus12
  • 17,824
  • 28
  • 99
  • 157
6
votes
1 answer

Run Jython and Python in one File

I developed a project using python. Now i need a gui for that project. So i choose jython for gui(java swing). I also integrate theme in one code (existing project + gui(jython) code). When i run the file with the following command then it shows a…
shantanu
  • 2,408
  • 2
  • 26
  • 56
5
votes
1 answer

Calling an overloaded Java method from Jython

I'm seeing some strange behavior I don't understand when I call an overloaded Java method from a Jython script. Here is my Java class: public class TestClass { public static float[][][] overloaded(float[][][] x) { return x; } public…
5
votes
1 answer

Jython UnsatisfiedLinkError on native method invocation in shared library

First off, here is what is working, and then I'll describe what is not: Using SWIG, we have taken some third party code, and created the Java and C wrapper source. A jar file of the Java classes, and a shared library of the C wrapper code was…
jbrogdon
  • 671
  • 1
  • 7
  • 15
5
votes
1 answer

Why is jython slow?

Jython performance is generally critized as slow --- is there a particular reason for this? Or is this just a modern myth? And most importantly, what is the future of Jython and how aggressively is it being developed? Will the ability to script in…
jayunit100
  • 17,388
  • 22
  • 92
  • 167
5
votes
2 answers

Jython wsadmin: get nodeName of server

In Jython WebSphere Wsadmin: It appears that I can get to the server's names from the nodeName, however I haven't managed to find a direct way to find the nodeName of a server. I thought about creating a map of all the nodes, but that is…
user967710
  • 1,815
  • 3
  • 32
  • 58
5
votes
2 answers

Do you know any dynamic instrumentation tool for Android with multi-device support (ideally in Python or Jython)?

For my CI infrastrucure I need to automatically deploy and run complex tests between two (or more) android phones from a controler machine (linux). So far android monkeyrunner in combination with android unit tests is not a satisfactory…
5
votes
1 answer

Python/jython coexisting in virtualenv

I have Python code split into a web frontend and consumer backend. The backend has to run under Jython for interoperability with some Java libraries, but we want to run the webserver in cpython/mod_wsgi because of memory problems we've had running…
SteveMc
  • 1,386
  • 8
  • 11
5
votes
1 answer

Preserving the Java-type of an object when passing it from Java to Jython

I wonder if it possible to not have jython automagicaly transform java objects to python types when you put them in a Java ArrayList. Example copied from a jython-console: >>> b = java.lang.Boolean("True"); >>> type(b) >>>…
Sebastian Ganslandt
  • 965
  • 2
  • 13
  • 26
5
votes
1 answer

When does running Jython on a .py file generate a .class file?

I just started playing with Jython, and sometimes running jython on a .py file generates a .class file, but this doesn't always happen. At first I thought the trigger was that you had to define a Python class inside the .py file, but evidently a…
espeed
  • 4,754
  • 2
  • 39
  • 51
5
votes
1 answer

jython java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/json/simple/ JSONObject

I needed to use a java code in python to reduce, so I chose Jython. after a while, I've managed to figure out how to run my code, but I'm having the strangest thing. When I write from vohmm.corpus import Token; most of the time, I'll get a…