I have a folder in my computer with many .txt
files:
file_one.txt --> location = r'C:\Users\User\data\file_one.txt'
file_two.txt --> location = r'C:\Users\User\data\file_two.txt'
file_forty.txt --> location = r'C:\Users\User\data\file_forty.txt'
How can I turn the name of the files (without the .txt
part) into a list like this:
list_from_files = ['file_one', 'file_two', 'file_forty']