mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
14 lines
263 B
Python
14 lines
263 B
Python
a = open('123.txt', 'wt')
|
|
a.write('123')
|
|
a.write('456')
|
|
a.close()
|
|
|
|
with open('123.txt', 'rt') as f:
|
|
assert f.read() == '123456'
|
|
|
|
with open('123.txt', 'a') as f:
|
|
f.write('测试')
|
|
|
|
with open('123.txt', 'r') as f:
|
|
assert f.read() == '123456' + '测试'
|