file - Python how to read the file content and write it back to the original file after modification
给我你的怀抱
给我你的怀抱 2017-06-28 09:25:30
0
1
1118

How to PythonRead File contentAfter modifying WriteReturn to the original file

给我你的怀抱
给我你的怀抱

reply all(1)
漂亮男人

Reference article: Issues related to Python file operations

Modify the file content and write back the original file

with open(filename) as f:
    file_str = f.read()
    
# do stuff with file_str

with open(filename, 'w') as f:
    f.write(file_str)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template