Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. #! /usr/bin/env python
  2.  
  3. print "\nNow i'm going to ask you for three lines.\n"
  4.  
  5. #  Raw_Input asks us for three "lines" and stores them into the variables
  6. line1 = raw_input('Line 1:')
  7. line2 = raw_input('Line 2:')
  8. line3 = raw_input('Line 3:')
  9.  
  10. print "I'm going to write these to the file."
  11.  
  12. with open('newfile', 'w') as target:
  13.     target.write(line1)
  14.     target.write("\n")
  15.     target.write(line2)
  16.     target.write("\n")
  17.     target.write(line3)
  18.     target.write("\n")
  19.  
  20. print "Done writing."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement