Is Jython compatible with Python?

Daniel Klein danielk at aracnet.com
Thu May 24 09:33:31 EDT 2001


On Thu, 24 May 2001 08:52:56 +0100, Simon Brunning <SBrunning at trisystems.co.uk> wrote:

>> From:	Daniel Klein [SMTP:danielk at aracnet.com]
>> Can modules written in Python be imported and used in Jython? Or do I have
>> to re-write the code?
>> What are the limits, if any?
> 
>Short answers - yes, no, and not many, respectively.
>
>Longer answer - there are a few minor inconsistencies, but nothing major.
>Nothing that you unit test won't find. You *do* have unit tests, don't you?
><wink>.
>
>A *very* few of the modules in the standard library aren't available for
>Jython, but I have never been caused a problem. YMMV.

The main reason I ask is that my first attempt to run an existing 'unit test' <wink * 2>, I was
rewarded with...

Traceback (innermost last):
  File "c:\python\jtest.py", line 16, in ?
  File "c:\python\jukebox.py", line 88, in connect
  File "c:\python\jukebox.py", line 160, in __init__
  File "C:\jython\Lib\popen2.py", line 141, in popen2
  File "C:\jython\Lib\popen2.py", line 33, in __init__
AttributeError: class 'org.python.modules.os' has no attribute 'pipe'

So I have to assume that the 'popen2' module has not been implemented.

Dan



More information about the Python-list mailing list