from sys import argv
(从sys import argv)
script,filename=argv,'hello.txt'
(脚本,文件名= argv,“ hello.txt”)
print("we are going to erase the %r" % filename)
(print(“我们将要擦除??%r”%文件名))
print("If you dont wanna delete, press esc")
(打印(“如果您不想删除,请按esc键”))
input("?")`
(input(“?”)`)
target=open(filename,'w')
(target = open(文件名,'w'))
print("the filename is %r" % filename)
(print(“文件名是%r”%文件名))
print("let's delete the file contents")
(打印(“删除文件内容”))
target.truncate()
(target.truncate())
print("lets start writing all the 3 lines.")
(print(“让我们开始写所有三行。”))
line1=input("the first line is :")
(line1 = input(“第一行是:”))
line2=input("the second line is:")
(line2 = input(“第二行是:”))
line3=input("the third line is:")
(line3 = input(“第三行是:”))
print("I am going to write these lines.")
(打印(“我要写这些行。”))
target.write(line1)
(target.write(line1))
target.write("\n")
(target.write(“ \ n”))
target.write(line2)
(target.write(line2))
target.write("\n")
(target.write(“ \ n”))
target.write(line3)
(target.write(line3))
target.write("\n")
(target.write(“ \ n”))
print("We are closing the file")
(打印(“我们正在关闭文件”))
target.close()
(target.close())
ask by Shivam Bhat translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…