import json
control={"bw":100,"delay": "10ms","jitter": None,"loss": 0,"max_queue_size": None,
"speedup": 0,"use_htb": True}
#data={"bw": 100,"delay": "1ms","jitter": None,"loss": 0,"max_queue_size": None,"speedup": 0,
# "use_htb": True}
json.dump(control,open('configuration.json','w'),indent=4)
#json.dump(data,open('configuration.json','w'),indent=4)
运行就生成.json文件了,生成之后可以对文件里的内容根据自己的需要进行调整。
文件运行结果:
{
"bw": 100,
"delay": "10ms",
"jitter": null,
"loss": 0,
"max_queue_size": null,
"speedup": 0,
"use_htb": true
}