Last active
November 6, 2025 06:21
-
-
Save makesomelayouts/72905be1a9ce71ebc17acf74cb3db155 to your computer and use it in GitHub Desktop.
file manipulation in python
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
| options: | |
| r=read, | |
| w=write (change old data to new data), | |
| rb/wb=read/write-binaryy (for binary files), | |
| a=append(add new data to old data). |
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
| with open('response.txt') as f: | |
| print(f.read()) | |
| f.close() |
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
| with open('1.txt', 'w') as f: | |
| f.write('Hello, world!') | |
| f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment