Created
March 23, 2014 15:58
-
-
Save melodykramer/9725109 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write mode says if it doesn't exist, create it. If it does, write over it. | |
If that's a problem, use append mode. Append mode says "if your file exists, great. if it doesn't exist, then it will add it to the end -- which is the beginning of a new file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
with open ("states.txt", "r") as
states_file:
states = states_file.read()
print states
states_file is a file object that is opening states.txt in read-only mode
states_file is a variable
strings are a type of object.