From: Steve C. <St...@ig...> - 2002-01-18 04:32:50
|
jython and ZipFile and Enumeration - what's happening here? [scohen@sleepingbear scohen]$ jython Jython 2.1 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> from java.util.zip import ZipFile, ZipEntry >>> zf =3D ZipFile("jython.jar") >>> entries =3D zf.entries() >>> entries java.util.zip.ZipFile$2@2a3e5b >>> entries.hasMoreElements() 1 >>> entries.nextElement() META-INF/ >>> entries.nextElement() META-INF/MANIFEST.MF >>> entries.nextElement() com/ >>> entries.nextElement() com/ziclix/ >>> entries.hasMoreElements() 1 >>> if entries.hasMoreElements(): ... print "hello" ...=20 Traceback (innermost last): (no code object) at line 0 File "<console>", line 3 null ^ SyntaxError: invalid syntax >>>=20 entries.hasMoreElements() returns 1 but if I use it in an expression I get this error. What's going on here? |