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,786
questions
0
votes
0
answers
25
views
executing wsadmin script from (inside) powershell script
How to execute a simple wsadmin script (using wsadmin.bat) from powershell script. Please help me.
Example wsadmin action -> AdminControl.invoke(cluster, 'stop')
Thanks,
Kumar.
0
votes
0
answers
19
views
is it possible to add the vtk library to jython 2.7.3 ?(non-native python libraries)
I use jython and I'd like to add the vtk library so that I can run my python code (code that uses vtk modules) on eclipse.
I installed jypthon and then I typed the command jython -m pip install vtk ...
0
votes
0
answers
48
views
Python modules using Jython
I am trying to make some utils for a Python script that run using Jython 2.7.0 (I could update if needed)
My current problem is pretty simple, i can't import/use my module
For a bit of context, my ...
1
vote
0
answers
28
views
Proper usage of Jython's PythonInterpreter for multiple scripts
Suppose I have a list of Python scripts, 'script1.py', 'script2.py', 'script3.py', etc. Using Jython (which is embedded into my Java application), my goal is to run each script when the Java program ...
1
vote
1
answer
33
views
Control Edit Properties of JTable in Jython
How would I be able to set certain columns of a JTable to be editable/not editable in Jython?
My table:
self.table_data = []
data_model = DefaultTableModel(self.table_data, self.colnames)
self.table = ...
0
votes
1
answer
318
views
How to get AST from Python code, change it, and write it back to file, in Java?
Question
How can one read an arbitrary Python file, build an abstract syntax tree from it, modify that, and then write the modified AST back to file, in Java? (Small note, for a concrete syntax tree (...
2
votes
0
answers
55
views
How to create GUI components using Ghidra Python Scripting?
Is someone here with experience in developing Python script for Ghidra?
It seems that there is not much information about python scripts, especially for GUI components.
I would like to create some GUI ...
0
votes
0
answers
68
views
Importing Java Class from a Python (Jython) Script fails
I need to automate execution of a small programm written in Java.
The programm has an API that can be accessed through a Python script that I am calling from Jython-Standalone. My Python script needs ...
0
votes
0
answers
33
views
How can I use an ExecuteScript processor to run a python script that reads unzipped data from an Unpack Content processor in Nifi?
I am trying to read and use the data that has come from an Unpack content processor with my python script. I know that I am supposed to use an Execute script processor to run the python script but I ...
0
votes
1
answer
69
views
Error with imports when loading own python extension in burp
I'm currently trying to create my own Burp extension to automatize testing. For this, I want to run script I made before via Burp. I need to import differents libraries for this, such as requests.
To ...
0
votes
0
answers
69
views
I am using jython library in java to execute a python script but it is not fetch python libraries
This the java code i am using
public void get_Inv_hash_ids(String token ,String url ,String url1) {
try {
String pythonPath = "/Users/milind.yadav/anaconda3/bin/...
1
vote
1
answer
35
views
Error managing bytes array while trying to code my first Burp extension
I'm currently trying to code my first burp extension in python and I have an error when it comes to managing bytes array which I get from the response. I used a, probably, outdated tutorial which use ...
0
votes
0
answers
85
views
Python script to compare the data types of a CSV in Apache NiFi
I have created this Python script to compare the data types of a CSV coming from the InputStream with an array of data types,
but I don't understand why I'm getting an error in line number 7 in NiFi.
...
0
votes
0
answers
20
views
Use HEC-DSS jython script in IDE PyDev-Eclipse
I need to know how to use javaHeclib.dll in PyDev-Eclipse and run a HEC-DSS jython scritps.
I try to set javaHeclib.dll as an external libraries in PyDev-PythonPath but without results.
I try also to ...
0
votes
0
answers
30
views
How to create a copy of an array with unusual typecode in Jython
I am using the Java library nom-tam-fits for reading and writing FITS files within Jython 2.7. I need to manipulate the underlying data arrays in the FITS HDUs however I am not able to make copies of ...
2
votes
2
answers
99
views
Stop webserver on particular node using wsadmin (jython)
Is there any way to stop webserver on particular node using wsadmin?
Using
print AdminConfig.list('WebServer')
I got the list of all webservers with coresponding nodes
webserver1(cells/dmgrCell01/...
2
votes
0
answers
46
views
Install Module pdfminer in Jython
I trying to connect a Python script with a Java project that uses Maven. To achieve this, I need to install a module into the Jython environment. I have tried the following approach.
C:\Users\lordonez\...
0
votes
1
answer
57
views
Why Do I Get List Indices Error When Changing How My Functions Are Called
This method is grabbing data from an API, and using a library I partially wrote called CAP. It takes three parameters the first two of which are dates, the third being an empty list to return data to.
...
1
vote
0
answers
95
views
Type comment list of values
I'm using Jython 2.1, so I cannot use type annotations ({var}: {type}) but I use type comments (# type: {type} for variables and # type: ({param_type}) -> {ret_type} for functions).
I would like to ...
0
votes
0
answers
114
views
How to change the FSRL for a file in Ghidra
Is there a similar way to change the FSLR ("File System Resource Locator") of a file in GHidra, like there is to change its "Executable Location" with 'currentProgram....
2
votes
0
answers
64
views
Can't install Jython packages
I'm trying to install Jython swingutils, but I get the following error whenever I try to install any package using pip: "No module named _winreg"
I am using Windows 10, and use Eclipse as my ...
1
vote
0
answers
31
views
Jython jInternalFrame Listener
I was able to get a listener working for a JFrame, but I'm missing something with doing the same thing with a JInternalFrame. I built up some basic code from various samples I found, and I'm hoping ...
0
votes
0
answers
44
views
ODI Jython command removes write protection from files
Created a procedure with Technology Jython which executes the following command:
import os
os.system(r'cat configuration.csv data.csv > data_out.csv')
Before running the code the file ...
1
vote
0
answers
45
views
Jython, wrong number of expected arguments
I'm writing a graphics app in Jython 2.7, and am doing something fundamentally wrong. I've stripped out most of the code for this question, and with the following code I get "TypeError: setColor()...
-2
votes
2
answers
1k
views
How to get JRE root path for java 17 using "java -verbose -version"
I have a problem that with my automation script where it needs to get the JRE Root path for java versions. I managed to get the path for java 8 and java 11 using java -verbose -version
enter image ...
2
votes
0
answers
127
views
Jython 2.7.3: Filereader: TypeError: read(): 1st arg can't be coerced to java.nio.CharBuffer, char[]
I am trying to read from a file: test1.txt
the file has only one line: abcdefghigk
java -jar jython-standalone-2.7.3.jar
Jython 2.7.3 (tags/v2.7.3:5f29801fe, Sep 10 2022, 18:52:49)
[Java HotSpot(TM) ...
0
votes
0
answers
48
views
Calling python having imports from 3rd party modules from Java using jython gives ImportModuleError [duplicate]
I am trying to create a maven java project which calls python script that have imports from 3rd party modules like pandas. I have installed Python3 and installed pandas using pip command. I am using ...
0
votes
0
answers
50
views
Import errors with Jython/opentripplanner even though the file is listed in the directory
I'm trying to use otp to generate some journeys to a list of destinations. I'm starting with the script outlined in this post: https://stackoverflow.com/a/33222627
However, this first import keeps ...
0
votes
1
answer
205
views
How to set Owner of SR in Maximo to first viewer
I want to create automation script, every time when I choose ticket in my list in service request and if owner is null to fill owner with logged user. I can not use automation script launch with ...
0
votes
1
answer
64
views
How can I check that my application is shutdown with QFTest?
I check a Java application with QFTest. I need to prove that the HMI is stopped at Shutdown.
In QFTest, I created a Jython procédure which try to send a socket to the HMI, if it can't, then it means ...
1
vote
1
answer
56
views
webbrowser library is not working as intended on SikulixIDE
On SikulixIDE, the library webbrowser always open the default browser, even when i use the get method, i tried my code on regular python, it does work. Anyone know why it is reacting like that ?
...
0
votes
0
answers
35
views
What known methods are there for automatically taring a scale?
I'm programming an Ignition project for work. Part of its job is to detect when a tote has been placed on the scale, then tell the scale to tare.
The values from the scale head (gross weight, tare ...
-1
votes
2
answers
59
views
sorting out data from two rows in csv file python
I have two rows of data in row 4 and 5. Row 4 has the titles for the data and row 5 holds the actual data. I want to go ahead and sort them out in any sort of format. I am completely new to python so ...
1
vote
1
answer
73
views
How can I pull data from two rows in csv with one being the header and other the data?
I have a CSV sheet with two rows of data in rows 4 and 5. Row 4 has the titles and row 5 has the corresponding data for it. How do I pull data and put it in another CSV sheet? The title row has ...
1
vote
1
answer
81
views
How to execute Python3 scripts during runtime in Java?
I want to run Python3 scripts during runtime in my Java application without having Python 3 installed on the system where I run the Java app (e.g. I ship single .jar to the customer).
I tried to use ...
0
votes
0
answers
71
views
Jython install pygame and use it with java in order to connect my controller [duplicate]
I'm working on a java project and I need it to be able to handle the DualShock 4 controller. I saw that with Pygame and a basic script I can use my controller (all the code is a the end). I can even ...
0
votes
0
answers
98
views
get Websphere installed application mapped shared lIbrary using jython script
I want to list the current mapped Shared libraries for specific application name
this is how i use for Shared lib mapping
AdminApp.edit(''+eval("app_Name")+'', '[ -MapSharedLibForMod [[ &...
0
votes
1
answer
152
views
Using DBShortcut to run a jdbc query in Python in Maximo - Getting unicode error - BIRT doesn't get error so how to process the error
I am running a jdbc query and using the result set to retrieve column values.
My output goal is a csv.
I am using Jython scripting in Maximo via the automation scripts.
I notice that I frequently get ...
0
votes
1
answer
62
views
NameError: name 'ResourceWarning' is not defined
java version "1.8.0_311"
Python 3.10.8
Sikuli:-
<dependency>
<groupId>sikulixapi</groupId>
<artifactId>sikulixapi</artifactId>
...
0
votes
0
answers
42
views
is jq compatible with jython?
We currently imported a new class we developed that uses jq to manipulate JSON into our burp's extension code. Upon loading it burp outputs an error of 'no module jq found'.
So after reinstalling ...
0
votes
1
answer
53
views
Increment Big integer by 1 in Jython
I have an attribute which has value stored in Big Integer and would like to increment it to 1. For example
A = 2,000
B = A +1
I tried the following however resulted in syntax error.
B = int(A) +...
0
votes
1
answer
16
views
Split Array into two equal half and same order in Jython
I have an array as below and I would like to split it into two equal array in the same order in jython. For example the below array is of length 160 and I would like to split it into two array with ...
0
votes
1
answer
32
views
how to remove trailing newline in jython
I am writing a code in Jython where I am reading data from a csv file and writing it to another csv.
but I am facing one issue:
I need to remove the trailing newlines and if I use newline='' in open ...
0
votes
1
answer
44
views
Why does this string return this way
Why does this code return jython string and not pjthon string?
str = "python string"
new_str = "j" + str[1:]
print(new_str)
result is jython string
1
vote
1
answer
210
views
trying to use jython with android studio
I am trying to use jython in my java app for android but I'm having trouble building the project with the .jar file.
here is my build.gradle:
plugins {
id 'com.android.application'
}
android {
...
0
votes
1
answer
229
views
Jython script to modify queue connection factories
I have queue manager already configured in Queue connection factories of websphere
currently settings are with out SSl enabled.
I want to enable this two things
Use SSL to secure communication with ...
0
votes
1
answer
100
views
SymPy in Jython
I'm making a calculator app. I am using Java and Jython. I wanted to use the SymPy module but after calling the code below I get an error that there is no such module. Any advice?
try (...
0
votes
0
answers
43
views
Conversion SQL to Jython with list and dict
Trying to convert this script in Jython (which doesn't have pandas)
It uses the tables Work, Budget, Grade, Office.
Now they are no longer tables,
Work and budget are a List
Grade and Office are ...
0
votes
2
answers
113
views
ImportError: cannot import name create_string_buffer
I'm using python script in mulesoft ,while importing a library the above error is occuring?
Any help would be much appreciated . Below is the error I get:
Message : ImportError: cannot ...
0
votes
2
answers
84
views
How do I run Python Scripts in Java with the ScriptEngine?
I'm trying to run Python Scripts in my Java Application with Jyton/ScriptEngine but it's not working.
ScriptEngine does not find JythonScriptEngine.
public static void main(String[] Args) throws ...