#-*-Coding:utf-8-*-
From sys import ARGV
script, filename = argv
Print "We ' re going to erase%r"% filename
Print "If you don t want this, hit Ctrl-c (^c)."
Print "If You do want this, hit RETURN."
Raw_input ("?")
Print "Opening the file ..."
target = open (filename, "w")
# Here's W should be the focus, there are many uses such as r A, brain cells are not enough
Print "truncating the file. goodbye! "
Target.truncate ()
# Here for the moment don't understand, online said this should have truncated function, but delete this line of code, run without any impact
Print "Now I ' m going-ask you for three lines."
line1 = Raw_input ("Line 1:")
Line2 = Raw_input ("Line 2:")
Line3 = Raw_input ("Line 3:")
Print "I ' m going to write these to the file."
Target.write (line1)
Target.write ("\ n")
Target.write (line2)
Target.write ("\ n")
Target.write (LINE3)
Target.write ("\ n")
Print "And finally, we close it."
Target.close ()
# There are several functions in the exercise, raw_input (), open (), truncate (), write (), close ()
# Open the document with the opening command first,
Stupid Methodology python--Exercise 16