def func(): with open('file1.txt'), open('file2.txt') as used: print(used)