1
Fork 0
mirror of https://github.com/RGBCube/JsonWrapper synced 2025-07-27 11:47:45 +00:00

Update set.py

This commit is contained in:
RGBCube 2022-01-30 11:44:34 +03:00 committed by GitHub
parent 7c20335573
commit c5a2c5de55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,23 @@
from json_wrapper import JsonWrapper from json_wrapper import JsonWrapper # Initialization
db = JsonWrapper("example.json") db = JsonWrapper("example.json") # Initialization
db.set("a", ["valu
# set normal
db.set("a", 123)
data = db.all()
print(data) # {'a': 123}
db.nuke()
# set pathmagic
db.set("a", 123, pathmagic="example+path")
data = db.all()
print(data) # 'example': {'path': {'a': 123}}}
db.nuke()