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".

-2
votes
0answers
18 views

Code dependent on indexing is not working correctly [duplicate]

Although I am not receiving error messages for my code, it is not giving me the data I am looking for. I tried changing the code in places, but a lot of the changes were cosmetic and did not give me ...
0
votes
0answers
20 views

How to fix “CodecNotFoundException: Codec not found for requested operation: [blob <-> java.lang.String]” while writing to Cassandra in Streamsets

I am trying to migrate an Oracle table to Cassandra, using Streamsets. Since their document says that default field mapping is not available for blob types in Cassandra, I am trying to use the Jython ...
2
votes
4answers
40 views

How do I get an if elif else statement to restart

I am a newbie, and am having trouble getting the following code to process. choice if: (statement is false) moves to elif statement elif: (statement is false) moves to else ...
0
votes
1answer
23 views

java.util.date returns 502 from jtOpen ObjectDescription.RESTORE_DATE

I have the following in jython talking to an AS400: system = AS400(ip, USER, PWORD) obj = ObjectDescription(system, 'qsys','jbrdata', 'lib') d = obj.RESTORE_DATE The object that returns is a java....
0
votes
1answer
19 views

IBM WebSphere: How to map an application to multiple clusters using wsadmin scripting?

I am trying to automate the deployments of an application which is mapped to two clusters in a cell using wsadmin scripting. But no matter how much I try, the application is getting mapped to only one ...
-1
votes
1answer
22 views

Configuring settings for last paricipant support wsadmin/websphere

Recently i've came to an issue to configure Last Participant Support on deployed application. I've found some old post about that: https://www.ibm.com/developerworks/community/forums/html/topic?id=...
0
votes
0answers
13 views

Python inside Java using Spring Integration. Error : javax.script.ScriptEngineManager is unable to create a script engine for language 'python'

I am trying to run a Python program inside Java using Spring Integration Framework. I have tried many things and I am quite puzzled. If someone has ideas what to do, that would be quite appreciated. ...
-1
votes
0answers
27 views

how to process the unicode character in the further program as is

I want to process unicode character endash as string in the further functions I could get the list but one of the ticket has unicode character endash in the allResponse as below if i print resp ...
0
votes
1answer
33 views

NoneType' object has no attribute 'split

Im using Jython on Soatest Parasoft and getting error when I'm ruining my test the test is for calling an API to get the response then compare with DB. test individually validated and both DB results ...
0
votes
1answer
29 views

How to create a list from api reponse and remove duplicates

I want to make a list from api json response as shown for each ticket in jira and remove any duplicates I can get the values for each ticket but not able to make it as list and remove duplicates ...
0
votes
0answers
31 views

Java call through Jython (Python) to run Ansible scripts through the Anisble Python API

I'm able to use Jython to call Python scripts through Java. I'm also able to use Python to call these Ansible scripts. However i can't seem to get the right configuration in order for Java->Jython(...
0
votes
0answers
24 views

Nifi: Overwriting xml content of flowFile in ExecuteScript

I was trying to overwrite flowfile xml content in Nifi using ExecuteScript for the past couple of days. Basically, I would like to add new subelement (new tag) within particular tag, and insert some ...
0
votes
1answer
21 views

Import Paramiko in Jython

I am trying to import python paramiko module from java program. So for that i used jython. When i try to import paramiko from jython it gives below error, Exception in thread "main" Traceback (most ...
1
vote
0answers
14 views

How to save an image to a new directory?

I am trying to save a file to a specific directory. The file ends up saving to the designated directory but when i go to open the file it tells me the file is empty. import os from os.path import ...
1
vote
0answers
25 views

The bytecode generated by Cpython vs the bytecode generated by Jython

I read about different implementations of python like cpython, jython and so on. And I was wondering if the bytecode generated by the compiler Cpython is the same bytecode generated by the compiler ...
-1
votes
0answers
7 views

How to write summation tone on jython

As the title asked, how can I write a summation tone (play three or more tones simultaneously )on jython? Ps. sorry if I get any word wrong cuz my native language isn’t Englishಥ_ಥ
0
votes
1answer
40 views

Nifi: Cannot import pyspark in ExecuteScript processor

I need to implement ExecuteScript in Nifi in order to do column transposition, and I am using pyspark as means to do that. But the problem says "failed to process due to javax.script.ScriptExeption: ...
0
votes
1answer
19 views

Maximo - Set value in MeterReading based on inbound values of METERDATA

We use Maximo 7.6. We have a requirement in Integration. We are receiving METERDATA thorugh interface (MXLoader).. It adds data in METERREADING, LOCMETERREADING and MEASUREMENT tables (OOB ...
0
votes
0answers
18 views

Java Python Tensorflow

I've learned the results from Tensorflow. I want to print it out from Java but there is one problem. ImportError: No module named numpy I'd like to know if there's a solution: interpreter.execfile("...
0
votes
1answer
33 views

how to parse multiple values with same object?

I want to parse the vaule of user from json response and send email to those id`s using python2.7 I can send it to one user, but not sure how to embed multiple users role = { "permissions": [], ...
0
votes
0answers
28 views

Read Message from JMS queue in sorted order

I am trying to read messages from JMS Queue but I want to read it in sorted order. I want to sort it by TimeStamp,as this is required for Message Recovery Script which will move messages from Error ...
0
votes
1answer
24 views

WebSphere wsadmin testConnection error message

I'm trying to write a script to test all DataSources of a WebSphere Cell/Node/Cluster. While this is possible from the Admin Console a script is better for certain audiences. So I found the following ...
0
votes
0answers
26 views

Printing SMTP server replies onto a file/variable

I have written a code in python to send an email using SMTP. Initially my issue was to get the queued of the generated mail. Details of the same are at below link using docmd to receive queue-id of a ...
1
vote
1answer
28 views

Importing External Sikuli Classes Into 1 Sikuli Script

Background I am currently working on creating utility classes in Sikuli/Jython for others to use for Automation Testing creation. Right now, I am having issues with importing the Utility Sikuli files ...
1
vote
0answers
24 views

how to get an NTLM authentication through jython script in maximo

trying to get a NTLM connection but my jython is not proficient enough to translate Authenticator part of the code. what information do i need to accomplish this? if this is even possible to do in ...
1
vote
0answers
19 views

How to specify a directory without an absolute path in Sikuli

I'm attempting to use the current directory in which the script is currently located in Sikuli to create a .txt document to output results to. So far the only way I've got this to work so far is by ...
1
vote
1answer
12 views

Is there any way to get Jython py_compile to not record the absolute path of the source file?

I'm using py_compile in Jython 2.5.3 to compile some Python files to $py.class files. I've noticed that this module seems to record the absolute path to the source file, so that if I move the ...
0
votes
0answers
30 views

is there a way to load an fxml file made in scene builder into python (jython) code?

I'm trying to make a desktop application which flashes ESP32 and i didn't find any way to do that in pure java instead am doing it in python except i want the GUI to be made in javafx . so is there a ...
0
votes
0answers
25 views

using docmd to receive queue-id of a mail from smtp server

I have written a code in jython 2.5, which uses the smtplib sendmail to send mail over a smtp server. Below is a simple snippet of the code mail = MIMEMultipart('mixed') mail['Subject'] = ...
0
votes
0answers
21 views

Unable to create hyperlink to new file created by user input

Hello running through a program for a Python / Jython class and running into an issue in the last portion. The code should prompt user for text 3 times and create a new hyperlink where the user can ...
0
votes
0answers
10 views

Problems when cropping pictures

I tried to crop pictures and logically it is right but when I tried to load it it shows that getPixel(picture,x,y): x (= 155) is less than 0 or bigger than the width (= 154). And I do not know why ...
0
votes
0answers
7 views

Support Jython scripts in IIS

I am setting up a server 2012 with IIS 8 server and want to support Jython as an interpreter. How do I do that or is that possible? We have a bunch of Python and Jython scripts that run on Apache. I ...
-1
votes
1answer
61 views

I am trying to read a file in in Google Cloud Storage bucket with a python code but getting the error

I am trying to read a file in stored in Google Cloud Storage bucket python: textfile = open("${gcs_bucket}mdm/OFF-B/test.txt", 'r') times = textfile.read().splitlines() textfile.close() print(...
0
votes
0answers
72 views

Displaying images from array JES/Python

I have to create a sliding block puzzle game from an image in JES/Jython/Python and I'm stuck on slicing the image up, or at least diplaying the slices from a list. I think I've sliced the image into ...
0
votes
0answers
47 views

How to get the control back after running wsadmin.bat with script file

I created a batch file and calling the wsadmin.bat with -f option, and not able to change the directory back to the initial position @echo off SET var=%cd% cd C:\IBM\WebSphere\AppServer\profiles\...
1
vote
0answers
46 views

Is there any way to reconcile Python C-Extensions in Java

I have some statistical & machine learning models written in Python using some of the standard Python libraries for such things (scikit-learn, pandas, numpy). I have these wrapped and served by a ...
0
votes
0answers
25 views

How to use Custom modules in Java PythonInterpreter

I need to use third party python module talon in my java application. So, I am using PythonInterpreter to call talon functions like below: PythonInterpreter interp = new PythonInterpreter(); interp....
0
votes
0answers
40 views

replicating functionality of oracle cursors with cursors in jython

We have a hyperion application, the source of which is Oracle EBS. We have an oracle package that pulls data from a combination of oracle EBS tables and dumps it into the hyperion application. We are ...
0
votes
0answers
35 views

Is there a way within a Java Maven project, to call Python code that imports Numpy

I have successfully put together a demo of Jython using the example: https://www.jython.org/jythonbook/en/1.0/JythonAndJavaIntegration.html#one-to-one-jython-object-factories I am attempting to add "...
0
votes
1answer
46 views

Is there a way to List the all Server status of Websphere from different hosts?

I'm trying to create a script which will display all JVM status. so far, i've created a script which basically calls serverStatus.sh and is then run from different hosts to get status of each JVM ...
0
votes
0answers
13 views

Jython TLS and network event framework

I am looking for a network event framework that works on Jython2.7 and supports SSL. The asyncore framework doesn't support TLS well. There is this TLSHandshake module but it seems to produce a "dead ...
0
votes
0answers
36 views

i cant use PIL in jython [duplicate]

I have a python code using PIL and i went to copy it in jython but it give me: ImportError: No module named PIL i search about it and found that PIL is C and unlikly to be "ported" to Java. So i ...
1
vote
1answer
25 views

Find Windows OS Version/Edition in Sikuli

I work in both a Windows 7 and 10 environment and the file locations don't match up. I'm trying to write a Sikuli script that will go in, check which Windows version is being used (7 or 10) and then ...
3
votes
1answer
72 views

How to fix wrong calculations in Python Mode for Processing?

I try to implement a visual illustration of Pascal's triangle with Python Mode for Processing for MAC OS X. One of the necessary steps is, of course, the calculation of the binomial coefficients in ...
1
vote
0answers
40 views

How to fix “OutOfMemoryError: java.lang.OutOfMemoryError: Java heap space” in JES

Im trying to grayscale an image in JES, the image is about 3000x2000 in size. Whenever I run it, gives me OutOfMemoryError: java.lang.OutOfMemoryError: Java heap space. Im fairly new to this language ...
1
vote
1answer
35 views

[WebSphere]: Items are not properly appending to a list and regex is failing

We are trying to stop a particular app without manual intervention through a combination of AdminApp.list() and regex. The end target is: Ease of USE. A user must be able to stop an application ...
0
votes
1answer
30 views

TypeError: execute() takes exactly 2 arguments (3 given) - execute method sqlite3 Jython

I'm currently working on a Python script run via Jython 2.7 and I'm using sqlite3 module for Jython (link) whose syntax is identical to CPython sqlite3 module. Here is the code: def file_exists(...
0
votes
1answer
54 views

Cannot import Python function in Jython

I wrote a Python script which is executed via Jython 2.7. I need SQLite, so I decided to use sqlite3 for Jython (link) which is under /usr/local/lib/jython/Lib. ghidra_batch.py import sys sys.path....
0
votes
0answers
33 views

Jython: how to restrict access to eval()?

I am no python/jython expert so I might be missing some obvious things -> sorry for that. In my app I want users to run (among others) python scripts using jython and JSR233: ScriptEngine engine = ...
1
vote
0answers
44 views

from bs4 import BeautifulSoup ImportError: No module named bs4 when calling a python method from java by using jython

I am using Jyhton to call my Python methods through the Java methods. Python methods contains BeautifulSoup to import bs4. These methods are working fine in Python. But when I call these methods from ...