I have following problem:
I put in one variable the output from os.lostdir
- this are .txt
files. The number of files can vary each day. I want to assign every .txt
file to a variable with the name of the .txt
file.
Is this possible?
For example:
I have three .txt
files a.txt
, b.txt
and c.txt
. I want to assign the contents of a.txt
to a variable a
. However, the file names can change every day. Is there a way to do this in python
?