jython

ImportError: No module named optparse in jython

getting Traceback (most recent call last): File "C:\projects\myproject\convert.py", line 139, in import optparse ImportError: No module named optparse. when executing it using jython. Same module works fine when i execute it through python. I am usinng window7 operating system. The same modle works fine on windows XP machine w...

Jythonc missing

Hi Guys, I just installed Jython 2.5.1. I want to convert my Python file into Java class file and it is instructed on the website to use the jythonc command-line tool but I can't find it. Does anyone know where I could find it? Basically what i was trying to accomplish is to get my Python code running client-side in a browser and the b...

how to create image thumbnails using django running on jython?

Hi guys, I am a newbee to django and jython. I need to create and save image thumbnails in database. I am using django running on jython and mysql database. I was exploring python imaging library, but the i found out that i wont work with jython. How do i create image thumbnails using jython and then save them in mysql db?? Any kind of ...

Developing WLST scripts with Eclipse

We are in the process of developing several WLST (WebLogic Scripting Tool) scripts and we would like to setup a development environment. Has anybody managed to configure Eclipse PyDev (or another plugin) to support it? Do you know any other alternative? Thank you for your answers. ...

How to load a springframework ApplicationContext from Jython

I have a class that loads a springframework application context like so: package com.offlinesupport; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class OfflineScriptSupport { private static ApplicationContext appCtx; public static fin...

Packaging and deploying a Jython program from Eclipse

So I've been pigeon-holed into writing some Jython code. I've been using the latest version of Eclipse IDE with the PyDev plugin for development. Up until now, things have been moderately tolerable. I've gotten all my Python scripts working and I'm successfully including a couple of JAR files and the class directory of another Java pr...

Integrating Jython Cpython

I am about to begin a project where I will likely use PyQt or Pyside. I will need to interface with a buggy 3rd party piece of server software that provides C++ and Java APIs. The Java APIs are a lot easier to use because you get Exceptions where with the C++ libraries you get segfaults. Also, the Python bindings to the Java APIs are ...

SqlAlchemy hangs after adding record in MS SQL

I'm running SQLAlchemy on Jython and trying to connect to a MS SQL database using jTDS with windows authentication. I can query and delete just fine but when I try to insert new values it will hang when I commit. print 'before add' session.add(newVal) print 'after add' session.commit() print 'after commit' I see the first two print s...

how to import Java class with Python using Eclipse?

Hi, I'm trying to write Jython where the Python file imports classes from Java I'm using Eclipse with PyDev. My Python code looks like: from eclipsejavatest import eclipseJavaTest from eclipsejavatest import JavaClass class eclipsePyPrint(eclipseJavaTest): def eclipsepyMain(self): print "python main method" ecli...

Orphan IBM JVM process

Hi people, I have this issue about orphan IBM JVM process being created in the process tree: For example: C:\Program Files\IBM\WebSphere\AppServer\bin>wsadmin -lang jython -f "C:\Hello.py" Hello.py has the simple implementation: import time i = 0 while (1): i = i + 1 print "Hello World " + str(i) time.sleep(3.0) My ...

jEdit+JythonInterpreter: how to import java class?

Hi, I'm running jEdit with the JythonInterprete and I have a .jar file called JavaTest.jar. JavaTest has a class called SampleJavaClass which has a method printerCount. From my .py file, I want to do: from javatest import SampleJavaClass class SampleClass(SampleJavaClass): def pymain(self): SampleJavaClass.printerCount(4) Java...

Pure python implementation of greenlet API

The greenlet package is used by gevent and eventlet for asynchronous IO. It is written as a C-extension and therefore doesn't work with Jython or IronPython. If performance is of no concern, what is the easiest approach to implementing the greenlet API in pure Python. A simple example: def test1(): print 12 gr2.switch() p...

php equivalent to jython?

hi i wonder if there is a php equivalent to jython so you can use java classes with php? thanks ...

Can I program for android using any JVM language?

Can I use other JVM languages besides Java (e.g. jruby, jython, clojure) to program for android, or is it java only? There was a similar question asked over a year ago but I wasn't sure if there'd been any change since then. ...

get environment ( windows or unix) using jython

hi everyone , how to find out if the environment is windows or unix . I want to execute such similar code as shown below. Please suggest import os if (os.getenv("windows"): os.system(cmd/c ...) if (os.getenv("unix") os.system(sh shellscript.sh) Thanks for all your help. ...

Jython CLASSPATH, sys.path and JDBC drivers

How can I add JDBC drivers at runtime to Jython? Using CLASSPATH works, but using sys.path doesn't work with zxJDBC even though the class is imported fine and can be manipulated from the Jython interpreter prompt. Why does this work: $ CLASSPATH=/tmp/jtds\-1.2.5.jar ./jython *sys-package-mgr*: processing new jar, '/private/tmp/jtds-1.2...

Import problem with PyCrypto in Jython

Hello, I am currently trying to get python bittorrent tracker running inside of jython and i encountered this problem: the tracker uses PyCrypto library which i compiled for my platform and added into the python path. When i try to run code, however, i get following error: Exception in thread "MainThread" Traceback (most recent call la...

jython syntaxerror?

Hi guys i got the following syntax error at the following line when i run my program in jython: except Exception as detail: SyntaxError: mismatched input 'as' expecting COLON but on python its ok? What's wrong? I'm trying to use the stanford pos tagger api (java) in my python program.are there other ways? ...

Jython project in Eclipse can't find the xml module, but works in an identical project

I have two projects in Eclipse with Java and Python code, using Jython. Also I'm using PyDev. One project can import and use the xml module just fine, and the other gives the error ImportError: No module named xml. As far as I can tell, all the project properties are set identically. The working project was created from scratch and the o...

xml.dom.minidom.parse() in Jython gives an error for XML files with <?xml... and <!DOCTYPE tags

It works fine as long as the XML files don't have <?xml version="1.0" encoding="UTF-8"?> and the DOCTYPE tags. I would switch to xml.etree but I already wrote quite a lot of code using minidom. The same thing works in Python. It sounds like a bug in Jython's minidom, but is there a way to work around it? ...