Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (19 sloc) 0.621 kb
from sys import argv
script, filename = argv
print "We're going to erase %r." % filename
print "If you don't want that, hit CTRL-C (^C)."
print "If you do want that, hit RETURN."
raw_input("?")
print "Opening the file..."
target = open(filename, 'w')
print "Truncating that file. Goodbye!"
target.truncate()
print "Now I'm going to 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 white these to the file."
content = "%s\n%s\n%s\n" % (line1, line2, line3)
target.write(content)
print "And finally, we close it."
target.close()
Jump to Line
Something went wrong with that request. Please try again.