I'm trying to open a file from a directory and file name is not fix. it could be anything and there are many files on the directory. I create a list of the file from the directory. Now I want to open the List file or first file of the directory. how could I do that. Thanks in advance.
- Code: Select all
#here I create a list
L = os.listdir("data_small")
file_object = open("data_small/L","r") #<--------- here needs change
#some code goes here