在使用此代码进行写文件然后读出来的时候,读出的文件为空
from sys import argv
script, filename = argv
print(f"We're going to erase {filename}.")
print("If you don't want that, hit CTRL-C (^C).")
print("If you do want that, hit RETURN.")
input("?")
print("Opening the file...")
target = open(filename, 'r+')
print("Truncating the file. Goodbye!")
target.truncate()
print("I'm going to write these to the file.")
target.write(