初始
This commit is contained in:
13
Client/main.py
Normal file
13
Client/main.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import tomllib
|
||||
|
||||
# 您的 TOML 字符串
|
||||
toml_str = '''{ a = "你好", "a-c-v" = "你好", b = "世界", }'''
|
||||
|
||||
# 反序列化
|
||||
data = tomllib.loads(toml_str)
|
||||
print(data)
|
||||
# 输出: {'a': '你好', 'a-c-v': '你好', 'b': '世界'}
|
||||
|
||||
# 访问数据
|
||||
print(data['a']) # 输出: 你好
|
||||
print(data['a-c-v']) # 输出: 你好
|
||||
Reference in New Issue
Block a user