SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # write
  2. todos_file = open("todos.txt", "wb")
  3. todos_file.write(bytes("buy a new domain name\n", "UTF-8"))
  4. todos_file.write(bytes("work on the side project\n", "UTF-8"))
  5. todos_file.write(bytes("learn a new programming language\n", "UTF-8"))
  6. todos_file.close()
  7.  
  8. # read
  9. todos_file = open("todos.txt", "r+")
  10. todos_file_contents = todos_file.read()
  11. print(todos_file_contents)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top