Questions tagged [jython-2.7]

Jython, successor of JPython, is an open source implementation of the Python programming language written in Java.

Jython 2.7 is the latest stable Jython release.

Jython 2.7.0 was released in May 2015 as the first stable Jython version with language and runtime compatibility with CPython 2.7.0. New features include support for pip, a native launcher for Windows and many more.

201 questions
3
votes
2 answers

reportlab in Jython "import error"

I am using jdk 1.8 and Jython 2.7.0.jar to execute my python Code. But It seems Jython does not support Python's 2.7 feature 'reportlab' module. My Java Code : package test; import java.util.logging.Level; import java.util.logging.Logger; import…
Newbee
  • 45
  • 1
  • 9
3
votes
1 answer

I get an error: "java.lang.NullPointerException: Inflater has been closed" when sending requests using requests 2.8.1 in Jython 2.7

My code: from Core.PythonLib import requests requests.packages.urllib3.disable_warnings() def go_url(self, url, data=None, headers={}): if data: send = requests.post else: send = requests.get response = send(url,…
Chp
  • 69
  • 8
3
votes
1 answer

How to integrate Python into Scala using Jython

I see that there is a way to integrated python into scala using jython as explained here [http://www.slideshare.net/JerryChou4/how-to-integrate-python-into-a-scala-stack-to-build-realtime-predictive-models-v2-nomanuscript ] In java, the below code…
Edwin Vivek N
  • 564
  • 8
  • 28
3
votes
0 answers

Why can't I access Jython access stdlib modules when called from tomcat?

I can take an application with the following code in it: PythonInterpreter interpreter = new PythonInterpreter(); interpreter.exec("import os"); interpreter.exec("import mylib"); Where the following is resources/Lib/mylib/__init__.py: from…
Wayne Werner
  • 49,299
  • 29
  • 200
  • 290
2
votes
0 answers

How to read the value of list/dict objects using a dot-notation string?

Given this bunch of python objects (lists and dicts): d = [ { 'props': { 'columns': [ { 'field': 'Hello' } ] } } ] How would I use a string using dot-notation to return the…
njminchin
  • 408
  • 3
  • 13
2
votes
0 answers

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) 64-Bit Server VM (Oracle Corporation)] on…
Peter Wu
  • 21
  • 1
2
votes
1 answer

Merge two dictionaries that have dictionaries as key values

Merge two dictionaries of dictionaries My question is similar to this one, but the answers don't produce the right result (for me?). Take these dictionaries: a = {'a': {'a': 1}} b = {'a': {'b': 2}} I want to produce: c = {'a': {'a': 1, 'b':…
njminchin
  • 408
  • 3
  • 13
2
votes
1 answer

Jython code stopped working after upgrade from 2.7.1 to 2.7.2

// MyPythonObject.java import org.python.core.PyObject; import org.python.expose.ExposedClassMethod; import org.python.expose.ExposedType; @ExposedType public class MyPythonObject extends PyObject { @ExposedClassMethod public void hello()…
ZhekaKozlov
  • 36,558
  • 20
  • 126
  • 155
2
votes
1 answer

Is it possible to make a Jython module with Kotlin?

I want to make a Python/Jython module written in Kotlin. Kotlin is a Java based language, so I'm wondering if it's possible to use it with Jython. If possible I would like it to be compatible with CPython, the same way Python modules are created…
Brendan
  • 55
  • 12
2
votes
3 answers

Determine if points are within a rotated rectangle (standard Python 2.7 library only)

I have a rotated rectangle with these coordinates as vertices: 1 670273 4879507 2 677241 4859302 3 670388 4856938 4 663420 4877144 And I have points with these coordinates: 670831 4867989 675097 4869543 Using only…
User1974
  • 276
  • 1
  • 17
  • 63
2
votes
2 answers

Retrive serialized JFrame to upload in MySql

I have an object in Jython that extends a Java Swing JFrame. My goal is to serialize it in order to save it on MySql, query the database, deserialize it and review the JFrame exactly as it was before it was deserialized (with all fields filled…
Memmo
  • 298
  • 3
  • 8
  • 31
2
votes
0 answers

Jython: Getting SSLError when doing requests get

Trying to do a REST get using Jython but getting an SSLError. Python 2.7.1 (default:0df7adb1b397, Jun 30 2017, 19:02:43) [Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_172 >>> import requests >>> r =…
Bilesh Ganguly
  • 3,792
  • 3
  • 36
  • 58
2
votes
1 answer

Run automation script from a Action?

I have Maximo 7.6.1.1. I would like to run an automation script from a custom Action button (in WO List View). I've created an automation script with an action as a launch point. And I think I need to somehow reference the action in Application…
User1974
  • 276
  • 1
  • 17
  • 63
2
votes
1 answer

Open trip planner script slower on days other than today

I'm making use of open trip planner using the jython scripting method explained here: http://docs.opentripplanner.org/en/latest/Scripting/ (specifically 'Using OTP as a library') and am using a script very similar to their example script For…
Deruijter
  • 2,077
  • 16
  • 27
2
votes
1 answer

gensim with jython

Im using Jython 2.7.1. It is working fine. I need to install gensim. Does this library works in jython? Thank you
bib
  • 944
  • 3
  • 15
  • 32
1
2
3
13 14