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

Send data from Java to Python and then return the response

I have a Java program which gets data from a database in the form of a list of objects and an object just has some primitive types associated to it like strings and ints. Now I need to pass the data from Java to a Python program to do some…
user2844485
  • 1,112
  • 3
  • 15
  • 26
6
votes
6 answers

how to tell if a string is base64 or not

I have many emails coming in from different sources. they all have attachments, many of them have attachment names in chinese, so these names are converted to base64 by their email clients. When I receive these emails, I wish to decode the name. but…
Setori
  • 10,326
  • 11
  • 40
  • 46
6
votes
1 answer

Error : no viable alternative at input 'for' Python

I have strange problem, when i am using Netbeans IDE , this line : total_stock = {items : 0 for items in product_stock} causes syntax Error: Syntax Error : no viable alternative at input 'for' But the same code runs perfectly fine in terminal…
Himanshu97
  • 541
  • 1
  • 9
  • 19
6
votes
1 answer

Jython image manipulation

This program is supposed to take the outline of an image, then split it into different quadrants, then color it, such as the Andy Warhol Marilyn Monroe picture. Every function up to the "Warholize" function works but it gets stuck on…
roger34
  • 275
  • 2
  • 6
  • 16
6
votes
4 answers

Fading a picture gradually

The idea of this function is to fade the top half only of the picture (make it gradually darker). Here is what I have but it seems to be making all of the top half solid black. def fadeDownFromBlack(pic1): w=getWidth(pic1) h=getHeight(pic1) for y…
roger34
  • 275
  • 2
  • 6
  • 16
6
votes
3 answers

How to know that the interpreter is Jython or CPython in the code?

Is there a way to detect that the interpreter that executes the code is Jython or CPython? I have another post: Jython does not catch Exceptions. For this case, if I know the interpreter is Jython, I can have different code that should work. if…
prosseek
  • 182,215
  • 215
  • 566
  • 871
6
votes
2 answers

PyDev Jython Interactive Console on Eclipse fails to be created

Why might my Jython Interactive Console fail to be created when called in Eclipse? Following the 'Using Jython in an IDE' instructions in the Jython manual (http://www.jython.org/jythonbook/en/1.0/JythonIDE.html) I have reached just before 'Listing…
user1472525
  • 263
  • 1
  • 2
  • 11
6
votes
2 answers

Beginner python programming help to crossfade sounds

Hello I am taking a programming class and I am completely lost with a question. We need to take two sounds and add them together. But the first sound starts of at full volume and the second starts silent and then slowing shifting the balance till…
user3019949
  • 71
  • 1
  • 2
6
votes
4 answers

Drawing Diagonal Lines Across a Picture

I am trying to draw parallel lines diagonally from the top right corner to the bottom left corner of a picture. I want it to look like this (lovely paint pic) def diagTopLBottomR(): pic=makePicture(pickAFile()) w=getWidth(pic) …
user3956566
6
votes
2 answers

What is the correct usage of zxjdbc to call stored procedures?

I am attempting to use zxJDBC to connect to a database running on SQL Server 2008 R2 (Express) and call a stored procedure, passing it a single parameter. I am using jython-standalone 2.5.3 and ideally do not want to have to install additional…
Vindicare
  • 213
  • 1
  • 12
6
votes
4 answers

Logging messages appear twice in console Python

I have found this answer to a seemingly similar issue, however (since I'm novice into Python) I am not sure how to implement this solution in my code (if it's the same issue after all). In my code I have the following…
Eugene S
  • 6,709
  • 8
  • 57
  • 91
6
votes
2 answers

Using Jython with M2Eclipse

I currntly use M2Eclipse for the majority of my Java development and Pydev for Python/Jython development within Eclipse. I would like to use Jython to prototype and test classes within my Java projects. The M2Eclipse plugin manages all the…
Martin
  • 7,089
  • 3
  • 28
  • 43
6
votes
4 answers

Standalone Jython: Import Error (Apache-POI)

Jython standalone jar is throwing the ImportError exception at the time that I try to use Jython alongside Apache-POI. Below you'll find how I call my Jython script: java -cp C:\jAutoMailerScript\lib\poi-3.9-20121203.jar -jar jython.jar…
Eder
  • 1,874
  • 17
  • 34
6
votes
2 answers

How to get urllib3 and requests working with jython 2.7 beta 1?

Smart folks, I would like to use the awesome requests module in my jython program. It installs and runs just fine in python but I cannot get it to install in jython. I have tried both Jython 2.7a2 and 2.7b1 on mac and ubuntu and get the same errors…
Gautam M
  • 777
  • 1
  • 6
  • 7
6
votes
2 answers

wsadmin + jython restart WAS appserver

Is it possible to stop/start WAS appserver using wsadmin (jacl/jython). I want to detele all caches on profile and then restart WAS appserver. I'm using wsadmin as standalone.