Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file1 = open("text1.txt", 'w') #Open the file otherwise create if it does not exist. Then the 'w' sets it equal to writing mode.
- file1.write("Hello World!\n") #Write into the file!
- file1.close() #Closes the file.
- file1 = open("text1.txt", 'r') #Set mode to read 'r'
- print(file1.read())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement