I want read all the files in certain folder one by one. I performed this code
import os
Folder='/home/tanvir/'
FolderList = ['N10fine1Sh0.3S0.1/']
for Loop in FolderList:
folderN = folder + Loop + str(0) + '.py'
if os.path.exists(folderN):
execfile(folderN)
else:
print('\nNo file 0.py in the folder precised, possible mistake on the folder name ! : {0}\n'.format(folderN))
exit()
And I get this error.
python tanvirtest.py
Traceback (most recent call last):
File "tanvirtest.py", line 55, in <module>
folderN = folder + Loop + str(0) + '.py'
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'