I have list like this:
test_list = ['test1','test2','test3']
I want to create from each element of the array a separate txt file and write content to that like in below:
for test in test_list:
print (test, outfile=testdir/test + '.txt')
Obviously this code doesn't work. I would like to know how can I do this?