Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sys import argv
- script, imported_file = argv
- print("Opening", imported_file)
- print("""
- Would you like to add lines to %s?
- \n RETURN for yes
- \n ^C for no
- """) % imported_file
- raw_input("...")
- test_text = open("imported_file", "r+")
- print(test_text.read())
- print("""
- What would you like to add to this text?
- Add three lines.
- """)
- added_line1 = "\n" + raw_input("Line 1: ")
- added_line2 = "\n" + raw_input("Line 2: ")
- added_line3 = "\n" + raw_input("Line 3: ")
- #error on this line
- test_text.write(added_line1 + added_line2 + added_line3)
- print("Here is your new file:")
- print(test_text.read())
- test_text.close()
- print("Hit RETURN to close program.")
- raw_input("...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement