def listdir(path):
 if (not hasattr(sys, 'frozen')):
  return os.listdir(path)
 (zipPath, archivePath) = splitZip(path)
 if (archivePath is None):
  return os.listdir(path)
 with zipfile.ZipFile(zipPath, 'r') as zipobj:
  contents = zipobj.namelist()
 results = set()
 for name in contents:
  if (name.startswith(archivePath) and (len(name) > len(archivePath))):
   name = name[len(archivePath):].split('/')[0]
   results.add(name)
 return list(results)

def listdir ( path ) : if ( not hasattr ( sys , 'frozen' ) ) : return os . listdir ( path ) ( zipPath , archivePath ) = splitZip ( path ) if ( archivePath is None ) : return os . listdir ( path ) with zipfile . ZipFile ( zipPath , 'r' ) as zipobj : contents = zipobj . namelist ( ) results = set ( ) for name in contents : if ( name . startswith ( archivePath ) and ( len ( name ) > len ( archivePath ) ) ) : name = name [ len ( archivePath ) : ] . split ( '/' ) [ 0 ] results . add ( name ) return list ( results )
list directory contents .