Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # write
- todos_file = open("todos.txt", "wb")
- todos_file.write(bytes("buy a new domain name\n", "UTF-8"))
- todos_file.write(bytes("work on the side project\n", "UTF-8"))
- todos_file.write(bytes("learn a new programming language\n", "UTF-8"))
- todos_file.close()
- # read
- todos_file = open("todos.txt", "r+")
- todos_file_contents = todos_file.read()
- print(todos_file_contents)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement