Advertisement
Bad_luck

Untitled

Sep 27th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from sys import argv
  2.  
  3. script, filename = argv
  4.  
  5. #It isn't really going to erase anything
  6. print "We're going to erase %r." % filename
  7. print "If you don't want that, hit CTRL-C (^C)."
  8. print "If you do want that, hit RETURN."
  9.  
  10. raw_input("?")
  11.  
  12. print "Opening the file..."
  13. target = open(filename, 'w')
  14.  
  15. #print "Truncating the file. Goodbye!"
  16. #target.truncate()
  17.  
  18. print "Now I'm going to ask you for three lines."
  19.  
  20. line1 = raw_input("Line1: \n")
  21. line2 = raw_input("Line2: \n")
  22. line3 = raw_input("Line3: \n")
  23.  
  24. print "I'm going to write these to the file."
  25.  
  26. target.write("%r , %r , %r") % (line1, line2, line3)
  27.  
  28. print "And finally, we close it."
  29. target.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement