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
1
vote
0 answers

JYTHON - java.lang.ClassNotFoundException

I'm trying to convert java serialized files to python pkl files removing class definitions, just storing the raw data import java.io import cPickle as pickle from pprint import pprint import os import com.cds.magellon.reports.beans.common def…
1
vote
2 answers

How to find the mime type of a content file in python without using Magic library?

Is there some way to determine the MIME type of a file by it's content without using Magic Library in Python/Django? I'm getting the content from a HTTP POST and I need to get the mime-type. I cannot trust the…
mar mar
  • 1,198
  • 1
  • 7
  • 9
1
vote
1 answer

Error in Image Crop function in Jython

Okay, so for an assignment I have to make a function crop() that will crop a picture in test_crop(). Here's the code. def crop(pict, startX, startY, endX, endY): width = endX - startX + 1 height = endY - startY + 1 canvas =…
user2387191
  • 65
  • 1
  • 4
  • 9
1
vote
1 answer

Trouble with Jython GUI

I am having a problem with my Jython GUI. I need to make the text field appear. I believe I am running into a problem with the Layout, but I am unsure about how to create a new FlowLayout in Jython. #!/usr/bin/env jython # Created by Joe…
1
vote
3 answers

Error when calling Python from Java and passing parameters

Below is the given code for calling Python from Java public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new test1( ).setVisible(true); } }); try { …
eddy
  • 11
  • 2
1
vote
1 answer

Missing attributes in imported class in Jython

I declared a Java class - class Beach { private String name, city; public Beach(String name, String city) { this.name = name; this.city = city; } } I imported this into jython and tried to create an object - import…
Kshitiz Sharma
  • 17,947
  • 26
  • 98
  • 169
1
vote
1 answer

White gridlines over image using JES (python)

How can I write a program using JES to draw “White” gridlines on an image where the horizontal gridlines are separated by 10 pixels and the vertical gridlines are separated by 20 pixels?
1
vote
1 answer

How to use keyDown() and keyUp() in sikuli?

This is my code snippet, reg = selectRegion("Selected a region") reg.keyDown(KEY_CTRL) reg.keyUp() My objective is to select some lines, as we do it by pressing CTRL and then scrolling down, but it throws java.lang.IllegalArgumentException:…
Praveen kumar
  • 597
  • 2
  • 14
  • 26
1
vote
2 answers

Does jython support class-level fixtures from unittest module

I am using unittest in Jython. (I am writing some Sikuli tests) I am able to make setUp() work, but I am unable to get setUpClass() running. Does anyone know if this is supported in Jython? Has anyone gotten it to work? import unittest class…
cage
  • 403
  • 1
  • 5
  • 8
1
vote
2 answers

Creating a list within a list - not working

Ok so I am having a problem whereby I need to make another list from a list I have already split. Here is the code. def lists(): instructionList = instructions() Lists = instructionList.split('\n') Instructions = [] for values1 in Lists: …
Danrex
  • 1,657
  • 4
  • 31
  • 44
1
vote
1 answer

Using .pyd library in Jython

Actually i'm about to start a project, in the company we are using java as a main technology in owr web app server (IBM WebSpher), but now we need to integrate existing technology with a new product recently purchased and is developed in C/CPython…
1
vote
1 answer

Jython graph library

I need to use python with Java in a project in which graphs (the kind with nodes and edges) plays a large role. I want to visualize those graphs in a simple GUI and update its node labels/edge weights/whatever every second or so. I also want to load…
1
vote
1 answer

Importing django modules from java

I am trying to call some classes from my django project using Java. Here is my code: PythonInterpreter interpreter = new PythonInterpreter(); PySystemState sys = Py.getSystemState(); sys.path.append(new…
Walucas
  • 2,549
  • 1
  • 21
  • 44
1
vote
0 answers

Wsadmin script for linux

I need functional wsadmin script for OS Linux. I want to deploy my application from linux into remote WAS server. I was looking for everywhere, but I found same erroneous scripts. My current script ending with exception: [exec] Exception in thread…
ekinek
  • 97
  • 1
  • 9
1
vote
1 answer

How to use ExpectJ in Jython?

In our company we use Jython for some reason. I need to extend it with the ExpectJ, but I could not figure out how to do it. I managed to download the expectj-2.0.7.jar, expectj-2.0.7-sources.jar and expectj-2.0.7-javadoc.jar files and made them…
Milo
  • 655
  • 1
  • 12
  • 25