Subclassing zipfile (new style class)

Matimus mccredie at gmail.com
Thu Sep 6 19:30:39 EDT 2007


> import zipfile
> class walkZip(zipfile):
>      pass
>
> if __name__ == "__main__":
>      print "Hello World"


`zipfile' is the name of the module, not a class. What you probably
want is this:

[code]
import zipfile
class WalkZip(zipfile.ZipFile):
    pass

if __name__ == "__main__":
    print "hello world"
[/code]

Matt




More information about the Python-list mailing list