Sample code for 30+ languages & platforms
Chilkat2-Python

Transition from Zip.GetEntryByName to Zip.EntryOf

Provides instructions for replacing deprecated GetEntryByName method calls with EntryOf.

Chilkat Chilkat2-Python Downloads

Chilkat2-Python
import sys
import chilkat2

success = False

zip = chilkat2.Zip()

# ...
# ...
pathInZip = "example.txt"

# ------------------------------------------------------------------------
# The GetEntryByName method is deprecated:

# entryObj is a CkZipEntry
entryObj = zip.GetEntryByName(pathInZip)
if (zip.LastMethodSuccess == False):
    print(zip.LastErrorText)
    sys.exit()

# ...
# ...

# ------------------------------------------------------------------------
# Do the equivalent using EntryOf.
# Your application creates a new, empty ZipEntry object which is passed 
# in the last argument and filled upon success.

ze = chilkat2.ZipEntry()
success = zip.EntryOf(pathInZip,ze)
if (success == False):
    print(zip.LastErrorText)
    sys.exit()