提交 eeb71511 编写于 作者: 逆流者blog's avatar 逆流者blog 🇨🇳

Python3 基础用法

上级 7957a8e1
import json
filename = 'numbers.txt'
with open(filename) as f_obj:
numbers = json.load(f_obj)
print(numbers)
import json
numbers = [2, 4, 5, 7, 1, 9]
filename = 'numbers.txt'
with open(filename, 'w') as f_obj:
json.dump(numbers, f_obj)
[2, 4, 5, 7, 1, 9]
\ No newline at end of file
[2, 4, 5, 7, 1, 9]
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册