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
2 answers

len(array) works from interpreter, fails when called within function

I have a simple function that works when I enter it in my Jython interpreter manually, but the call to len() fails when I try to run the code as a function. def calculateChecksum(self, command): sum = 0 for b in range(len(command)): …
emw
  • 13
  • 2
1
vote
1 answer

how to add module of python into java using jython jar

I used Netbeans platform to build my application uasing java languge.I need to invoke some python functions into java class using jython was the only way. unfortunatly when I tried to run the program an error showed indicate that the application did…
Abrial
  • 421
  • 1
  • 5
  • 20
1
vote
1 answer

Cannot run netbeans IDE After Adding python plug in

I added this plug in to my netbeans 7.2 IDE. Then, when I restarted the program and tried to open it again it did not open as shown in this picture I tried to restore my Windows system to previous restore point but the problem still exist. any…
Abrial
  • 421
  • 1
  • 5
  • 20
1
vote
0 answers

Using serial port within monkeyrunner

I'd like to be able to access serial port from within monkeyrunner script. I've got separate python script that talks via rs232 to a device, and I've got a monkeyrunner script that drives an Android smartphone. Now. After implementing the python…
Jakub Czaplicki
  • 1,787
  • 2
  • 28
  • 50
1
vote
1 answer

How can I use a Java timer from within a jython class to schedule one of the classes methods?

I've got a jython class, which runs as a thread. I want its run method to create a java Timer, and then schedule one of my class's functions: class IBTHXHandler(threading.Thread): def __init__(self): threading.Thread.__init__(self,…
Zobal
  • 143
  • 2
  • 11
1
vote
0 answers

POI moving data from a csv to xls

I am relatively new to Python and at the moment I am trying to finish this small piece I am currently working on. High-Level: Moving 2 columns of data from a .csv file to an .xls using POI with Jython. Low-Level: Reading only two columns worth of…
Andrew
  • 11
  • 2
1
vote
3 answers

jython 2.5 can't print string

Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06) [Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_20 Type "help", "copyright", "credits" or "license" for more information. >>> print 3 3 >>> print "3" ... I tried version…
thinker3
  • 12,771
  • 5
  • 30
  • 36
1
vote
1 answer

how do i write a program to click a particular link in Python

My program takes an user input and searches it through a particular webpage . Further i want it to go and click on a particular link and then download the file present there . Example : The webpage : http://www.rcsb.org/pdb/home/home.do The search…
Nodnin
  • 451
  • 2
  • 9
  • 21
1
vote
1 answer

How can I get html source from a request using The Grinder

I have the following script: def page2(self): """GET / (request 201).""" result = request201.GET('/mypage/', None, ( NVPair('Accept', 'image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x- shockwave-flash, */*'), …
sarbo
  • 1,661
  • 6
  • 21
  • 26
1
vote
1 answer

Jython: Is there any difference between adding to sys.path vs passing -D?

I have a python application that is trying to load some Java libraries (specifically Axis2 web services). When I add the necessary jars in Eclipse via PyDev Project Source Folders, everything seems to work fine. However, I want to be able to do this…
trinth
  • 5,919
  • 9
  • 40
  • 45
1
vote
2 answers

wsadmin + jython delete folder

I want to do post-deploy script using standalone wsadmin. It should delete all caches on profile (/profile/temp /profile/myCacheFolder). My question is, is it possible to do this with wsadmin? If so how? Can I somehow use AdminConfig.deleteDocument…
bilak
  • 4,526
  • 3
  • 35
  • 75
1
vote
1 answer

Listening EventBus in Jython

I'm trying to use EventBus from Jython. Sending events to the from Jython bus works as expected, they can be listened from my Java code. But subscribing to the bus from Jython is problematic. I'm trying this: class Listener(EventTopicSubscriber): …
Joonas Pulakka
  • 36,252
  • 29
  • 106
  • 169
1
vote
1 answer

Android MonkeyRunner exception

I'm trying to run MonkeyRunner Android test tool from Eclipse (4.2). I installed Eclipse PyDev plugin, as well as Jython 2.5.1. My PyDev interpreter is set to Jython / 2.5. I created a Jython project in Eclipse with a simple jython file: # Imports…
gpo
  • 3,388
  • 3
  • 31
  • 53
1
vote
2 answers

How to flip a picture diagonally

Like this https://i.stack.imgur.com/NinbE.jpg This is what I have but it's not working and I'm not sure why. def mirrorDiagonal(picture): for sourceX in range(0,getWidth(picture)): for sourceY in range (0,getHeight(picture)): …
John Calzone
  • 41
  • 2
  • 5
1
vote
1 answer

jython - is there a way to avoid having to use "super__" methods?

NB this is really a question for Jython devotees but seems to highlight a design difficulty in the language if I do sthg like this class XTreeModel( DefaultTreeModel ): def fireTreeNodesInserted( self, source, path, child_indices, children ): …
mike rodent
  • 14,126
  • 11
  • 103
  • 157
1 2 3
99
100