Sep-15-2018, 08:47 AM
(This post was last modified: Sep-15-2018, 08:47 AM by SoulsKeeper.)
Hello, I want the script to go through the entire folder and only list the files which are neither Zip or Rar files
but when I use this code, it just goes through the entire folder listing all the files, what am i doing wrong?
but when I use this code, it just goes through the entire folder listing all the files, what am i doing wrong?
import zipfile, os, rarfile, unicodedata from rarfile import RarFile rootFolder = u"C:/Users/user/Desktop/archives/" from zipfile import ZipFile rootFolder = u"C:/Users/user/Desktop/archives/" zipfiles = [os.path.join(rootFolder, f) for f in os.listdir(rootFolder)] [print(i) for i in zipfiles if not isinstance(i, ZipFile) and not isinstance(i, RarFile)]