Apr-22-2017, 03:19 AM
I have 2 types of file types in a folder .docx/.doc and .pptx/.ppt, I have written a python script to cut and paste them into 2 folders one documents and the other powerpoints.
How can this be fixed?
import os FileTypeList = [".doc",".ppt"] dirList = os.listdir(os.getcwd()) for FileType in FileTypeList: for item in dirList: if FileType in item: print(True) else: print(False)It always prints False. When I try:
if ".doc" in "document.docx": print("True") else: print("False")This prints True.
How can this be fixed?