I have few mail files
stored without any extension:
how to open them??
with open('1', 'r') as fp:
content = fp.read()
This way, the file will always be closed.
To add on to @math2001's answer, you could do something like this:
numOfFiles = #int
data = []
for files in range(1, numOfFiles+1):
with open(str(files), 'r') as f:
// do whatever data processing you need to do
fileData = f.read()
data.append(fileData)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With