In [1]:
f = open("test.txt",'w')
f.write("a file test string.")
f.close()

In [3]:
f = open("test.txt",'r')
astring = f.read()
f.close()
print(astring)


a file test string.

In [ ]: