jython

Jython saying "No visible constructors for class"

I have a jython servlet as part of a large application running in tomcat5. I tested a few Spring Framework classes and create the objects in the Jython servlet. When I try to create objects of classes in the application I catch an Exception message "No visible constructors for class". These java classes do have a public constructor class...

Jython java call throws exception asking for 2 args when only one arg is coded

I have an Java method I want to call within my Jython servlet running on tomcat5. It looks like this: @SuppressWarnings("unchecked") public School loadByName(String name) { List<School> school; school = getHibernateTemplate().find("from " + getPersistentClass().getName() + " where name = ?", name); return un...

how to get the latest file in the folder

hi everyone , i have written the code to retrieve and file and time it got created by i just want to get the latest file name created. Please suggest how can i do that in jython . import os import glob import time folder='C:/xml' for folder in glob.glob(folder): for file in glob.glob(folder+'/*.xml'): ...

why does using "\" shows error in jython

Hi, I am trying to use a copy command for Windows and we have directories such as c:\oracle. While trying to execute one such, we get the following error: source_file=folder+"\" ^ SyntaxError: Lexical error at line 17, column 23. Encountered: "\r" (13), after : "" Here folder is my path of c:\oracle and whi...

Using NumPy and Cpython with Jython

I must use a commercial Java library, and would like to do it from Python. Jython is robust and I am fine with it being a few dot releases behind. However, I would like to use NumPy as well, which obviously does not work with Jython. Options like CPype and Java numeric libraries are unappealing. The former is essentially dead. The latter...

QtJambi and Jython

I'm trying to get QtJambi and Jython to play nice together. Here's what I'm doing as a test: >jython -Dpython.path=./qtjambi-4.5.2_01.jar:./qtjambi-linux64-gcc-4.5.2_01.jar:. Jython 2.2.1 on java1.6.0_18 Type "copyright", "credits" or "license" for more information. >>> from com.trolltech.qt.gui import * >>> dir(QApplication) ['aboutQt'...

Need to create tql queries

Hi, I need to create TQL queries to query out sets of data from the UCMDB. I am having 2 problems: 1. How can I find relationships which exists between CIs ( i do not have administrative privileges so need to do it in code somehow) I need this to get required data. I have created the following query: But I keep getting the IP property...

Using urllib2 with Jython 2.2

I'm working with a product that has a built-in Jython 2.2 instance. It comes with none of the Python standard libraries. When I run this instance of Jython, the default path is ['./run/Jython/Lib', './run/Jython', '__classpath__'] I added all of the .py module files from Python 2.2 to the ./run/Jython/Lib directory, and I am able t...

Deploying with Django-Jython, and Tomcat?

Hi, I have a Django app we're attempting to deploy to a Tomcat server, using django-jython. Just to test things, I've created the WAR archive file for a empty Django app successfully. The test Django application is called "chair". Our Tomcat server apparently doesn't like WAR archives files, so I exploded (unzipped this), and copied t...

JES - Create picture with rectangles, circles and half-circles

http://u.snelhest.org/i/2010/07/06_3754.png I'm trying to draw this picture in JES, jython. I've forgotten some of the basic math from school, so it's kinda difficult . I've done the full circle, but i'm not sure how to continue from there. Each rectangle, half-circle and circle is inset by 10 pixels, and the picture is a 200x200 squar...

how can we run python script(which uses nltk and scrapy) from java

Hi all! I have written python scripts that use scrapy,nltk and simplejson in my project but i need to run them from java as my mentor wants to deploy them on a server and i have very less time to do this.I took a glance at runtime.exec() in java and jython, needless to say that running system commands from java doesn't look simple eithe...

Send Raw hex data in jython udp packet

I'm experience with Java, but I have to integrate a java library into a co-workers python code. Enter jython, yay! We are trying to send a UDP packet with a very specific data section. We are building up the packet like so: version = 0x0001 referenceNumber = 0x2323 bookID = byteArray('df82818293819dbafde818ef') For easy of explanati...

Importing python modules in jython

I'm having some issues importing scapy under jython. I've been doing java forever, but python for only a day or two. The simple case to reproduce the problem is: $jython >>> import sys >>> sys.path ['', '/usr/share/jython/Lib', '/usr/lib/site-python', '__classpath__'] >>> from scapy.all import * Traceback (innermost last): File "<cons...

is None vs. ==None

I recently came across this syntax, I am unaware of the difference. I would appreciate it if someone could tell me the difference. ...

Why not Rhino for JVM apps?

I would like to develop some apps for the JVM using a concise, dynamic language. The most popular choices for this seem to be Jython, JRuby, Groovy, and maybe Clojure. Rhino appears to be fast and very stable, but I see no books on Rhino development and little discussion. Why is there apparently little use of JavaScript for other than e...

Getting Python's nltk.wordnet module working for Jython.

Hello, I've read through the FAQ for Jython and this post http://stackoverflow.com/questions/471000/jython-and-python-modules but am not sure how I can determine if a module is written purely in C or Python. The problem I'm facing is mentioned here http://old.nabble.com/using-NLTK-in-Jython-td28520926.html Can anyone that has done thi...

Reading an sqlite database from Jython.

I am trying to run the jython sqlite examples posted here. ################################################################################ # # sqlite_using_ziclix - An example of using the Python DB-API 2.0 compliant # ziclix implementation to interact with a SQLite database. # Creates a ...

Are there frameworks for Jython or JRuby, or is it you can run a py or ruby app on the JVM?

Are there specific frameworks for Jython or JRuby, or is it you can run a py or ruby app on the JVM? i.e. you take your python django app, and you can run in on tomcat using jython? Sorry little confused. ...

CPython vs. Jython vs. IronPython for cross-platform GUI development.

I'm thinking of making some kind of experimental IDE for digital hardware design. So I can't decide witch platform to choose. I'm going to have text-editor with syntax highlighting, some vector graphics and lots of tabbed windows. My goals: 1. to make GUI using as less custom components as possible. 2. to make it as cross-platform as p...

Pydev hangs up when I try to debug jython

Am running Eclipse Build id: 20100218-1602 with Pydev 1.60. My code executes under python and jython, and also debugs fine under python. But when I try to debug under jython I get the message pydev debugger: starting --and then everything hangs. It looks like a couple processes are running in the debug screen but no code is display...