with open("file.txt") as f:
lines = f.read()
lines.split("\n")
import tempfile
with tempfile.TemporaryDirectory() as tempdir_path:
print(f'I have a temporary directory at: {tempdir_path}')
with tempfile.TemporaryFile(mode='w+') as file:
file.write('hello, world')
file.seek(0)
print(file.readlines())