When attempting to read a file in python it seems to print out just a space instead of "Test Message" here's my code:
contents = "Test Message"
def readAndWritetofile():
with open("file.txt", 'w+') as file:
file.write(contents)
print(file.read())
readAndWritetofile()