W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
demo_python_ref_file_truncate.py:
f = open("demofile2.txt", "a") f.truncate(20) f.close() #open and read the file after the truncate: f = open("demofile2.txt", "r") print(f.read())
[email protected]
:/home/python#python demo_python_ref_file_truncate.py
Hello! Welcome to de