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
7
votes
1 answer

How to create Sphinx-based documentation in a Jython project?

I'm working on several Jython projects using libraries written in Java. I'd like to create some good documentation with Sphinx thanks to the autodoc extension. However when I try to create the html, I get errors because autodoc can't find the…
Taurus Olson
  • 3,153
  • 2
  • 26
  • 21
7
votes
1 answer

How to control where $py.class files go?

When importing modules for the first time, Jython creates $py.class files (Jython equivalent of .pyc) in the same directory as the corresponding .py file. A problem arises when the process has no permissions to write into that directory (everything…
Joonas Pulakka
  • 36,252
  • 29
  • 106
  • 169
7
votes
2 answers

In Python how do I test if the interpreter is running Pyston, Jython, CPython?

I would like to test from inside a running Python program if the interpreter is running pyston, jython, ironpython, pypy and so on. The things that come to mind are pattern matching on system.version and checking the magic number from…
rocky
  • 7,226
  • 3
  • 33
  • 74
7
votes
6 answers

Jython: Making a simple beep on Windows

I'm working with Sikuli, which (I think) is build on Jython. I want to make a script that does a small gentle beep to attract the user's attention. (This is on Windows.) How can I do this? I see that the winsound module is not available on…
Ram Rachum
  • 84,019
  • 84
  • 236
  • 374
7
votes
7 answers

How do I handle Microsoft outlook winmail.dat? Any other surprises?

Ive decided that I really dont like microsoft and their ways. Please could you give me directions on how to handle winmail.dat in emails, is there a jython library or a java library that will allow me to handle this. Ive just completed a email…
Setori
  • 10,326
  • 11
  • 40
  • 46
7
votes
2 answers

Deploying with Django-Jython, and Tomcat?

I have a Django app we're attempting to deploy to a Tomcat server, using django-jython. Just to test things, I've created the WAR archive file for a empty Django app successfully. The test Django application is called "chair". Our Tomcat server…
victorhooi
  • 16,775
  • 22
  • 90
  • 113
7
votes
7 answers

How do I fix UnsupportedCharsetException in Eclipse Kepler/Luna with Jython/PyDev?

Example code: from java.lang import System if __name__ == '__main__': [System.out.print(x) for x in "Python-powered Java Hello World from within a List-Comprehension."] Annoying output: console: Failed to install…
Ericson Willians
  • 7,606
  • 11
  • 63
  • 114
7
votes
1 answer

How do you invoke a python script inside a jar file using python?

I'm working on an application that intersperses a bunch of jython and java code. Due to the nature of the program (using wsadmin) we are really restricted to Python 2.1 We currently have a jar containing both java source and .py modules. The code…
Trevor
  • 95
  • 3
  • 6
7
votes
2 answers

How to extend a jython class in a java class

I would like to extend a jython class in a java class public class JavaClass extends JythonClass how do I import the Jython class? Does it have to be compiled? A link to documentation would be already useful. Example: class…
Davoud Taghawi-Nejad
  • 16,142
  • 12
  • 62
  • 82
7
votes
0 answers

Jython stalls on 1 = 2

I have been investigating jython a bit, and at the jython terminal accidentally typed 1 = 2 instead of q = 2, and found this: >>> 1 = 2 ... ... I had to Ctrl+C to get out of it. No other input seems to make it happy. I put the same code in a…
Seth
  • 45,033
  • 10
  • 85
  • 120
7
votes
1 answer

Are CPython, IronPython, Jython scripts compatible with each other?

I am pretty sure that python scripts will work in all three, but I want to make sure. I have read here and there about editors that can write CPython, Jython, IronPython and I am hoping that I am looking to much into the distinction. My situation…
Charles
  • 3,734
  • 3
  • 31
  • 49
7
votes
2 answers

What security privileges does Jython need, to successfully run untrusted Python code?

In brief Jython is running in a JVM with a security manager. The security manager should not prevent the Jython engine itself from doing its job, but it should not allow any privileged action by the python script running within Jython. What is the…
Travis Wilson
  • 949
  • 9
  • 19
7
votes
4 answers

"sys-package-mgr*: can't create package cache dir" when run python script with Jython

I want to run Python script with Jython. the result show correctly, but at the same time there is an warning message, "sys-package-mgr*: can't create package cache dir" How could I solve this problem? thanks in advance~~~
rmn190
  • 611
  • 1
  • 9
  • 19
7
votes
3 answers

Randomly select x number of items from class list in python

In jython, I have a class of objects defined like this: class Item: def __init__(self, pid, aisle, bay, hits, qtyPerOrder): self.pid = pid self.aisle = int(aisle) self.bay = bay self.hits = int(hits) self.qtyPerOrder =…
user1683885
  • 81
  • 2
  • 5
7
votes
1 answer

Upgrading Jython from 2.2.1 version to 2.5.2, possible risks

We want to upgrade our version of Jython to 2.5.2. After reading documentation and testing, it seems like the only thing we have to do is to add the encoding magic comment in the beginning of each python file, i.e. #encoding=utf-8 It seems too easy…
juankysmith
  • 11,839
  • 5
  • 37
  • 62