import os
with open('/tmp/test-file.txt', 'w') as f:
    f.write('first line\nsecond line\nthird line\n')
with open('/tmp/test-file.txt', 'r') as f:
    for line in f.readlines():
        print(line)
if os.path.exists(f.name):
    os.remove(f.name)
    print(f'{f.name} deleted')
else:
    print(f'{f.name} does not exist.')

3872f28143018193de844c74023797ae4ce8bbf6
<mask token>

<mask token>
with open('/tmp/test-file.txt', 'w') as f:
    f.write('first line\nsecond line\nthird line\n')
with open('/tmp/test-file.txt', 'r') as f:
    for line in f.readlines():
        print(line)
if os.path.exists(f.name):
    os.remove(f.name)
    print(f'{f.name} deleted')
else:
    print(f'{f.name} does not exist.')

import os
with open('/tmp/test-file.txt', 'w') as f:
    f.write('first line\nsecond line\nthird line\n')
with open('/tmp/test-file.txt', 'r') as f:
    for line in f.readlines():
        print(line)
if os.path.exists(f.name):
    os.remove(f.name)
    print(f'{f.name} deleted')
else:
    print(f'{f.name} does not exist.')
