The link you posted is not working for me.
Please read this post
with regards on how to post questions.
please just post the code here. That is why we have code tags. Plus you could of just copy/pasted the output instead of posting a screenshot.
Hey, Thanks you guys for guiding me the way to post my question properly. and thanks for your answers, that really help me to understand my script.
Ok, here's another question of mine regarding the script.
- Code: Select all
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."
print "Opening the file..."
target = open(filename, 'w')
print "Truncating the file. Goodbye!"
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 write these to the file."
print "And finally, we close it."
May I know that how can I use strings, formats, and escapes to print out line1, line2, line3
with just one target.write()
command instead of 6? since there are too much of repetition for the command target.write()
Thanks for your time!