This file contains 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
#example file writing procedure | |
f = open("/home/sharocko/Documents/Codecademy/output.txt", "w") #open the file for writing | |
f.write("Hello World\n") #write a string to the file | |
f.close() #close the file when we're done | |
#example file reading procedure | |
f = open("/home/sharocko/Documents/Codecademy/output.txt", "r") #open the file for reading | |
print f.read() #read data from the file | |
f.close() #close the file when we're done |
NewerOlder