Last active
November 1, 2021 17:07
-
-
Save KrisYu/207f44c681634cefdbf2afc909b93f51 to your computer and use it in GitHub Desktop.
read and write file
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
with open('filename') as f: | |
lines = f.readlines() | |
with open('write','w') as f: | |
f.write('Hello\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment