1

请注意:

PS Z:\dev\poc\SDR> jython.bat
Jython 2.5.3b1 (2.5:5fa0a5810b25, Feb 22 2012, 12:39:02)
[Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_27
Type "help", "copyright", "credits" or "license" for more information.
>>> from zipfile import ZipFile
>>> z=ZipFile('d:/ookla/us_aaa.zip')
>>> z.open
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: ZipFile instance has no attribute 'open'
>>> ZipFile.open
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: class ZipFile has no attribute 'open'
>>>

那么,open方法在哪里呢?

谢谢。

4

1 回答 1

1

它不可用。ZipFile.open是在 Python 2.6 中添加的,但 Jython 仍然是 2.5 版本。

该方法已添加到Jython 开发存储库中。

另请参阅如何在 Python 2.5 中模拟 ZipFile.open?.

于 2012-04-14T12:30:48.380 回答