Is there a way I can use glob on a directory, to get files with a specific extension, but only the filename itself, not the whole path?
If you are looking for CSV file:
file = [os.path.basename(x) for x in glob.glob(r'C:\Users\rajat.prakash\Downloads//' + '*.csv')]
If you are looking for EXCEL file:
file = [os.path.basename(x) for x in glob.glob(r'C:\Users\rajat.prakash\Downloads//' + '*.xlsx')]