Python - Validate if a sheet exists in my document xls
Python - Validate if a sheet exists in my document xls I am trying to design a small program on my free time which loads an xls file, then select a sheet in the document to be scanned. Step 1: the user imports an .xls file . After importing the program checks whether the file exists. (That I can do ) Step 2: I ask the user to give the name of the document sheet xls to analyze. And that 's where it stops. the program does not detect the sheets available :( #check if the document exist while True: x = input("Give the name of the document in this repository__") input_filename = x + ".xls" if os.path.isfile(input_filename): print ("the document is been charged") break else: print("xls not found !") #Load the document xls_file = pd.ExcelFile(input_filename) #Select the good sheet in file print ("this is your sheets in this document",xls_file.sheet_names) while True: feuilles = input("Selec...
