python - How can I load a saved JSON tree with treelib? -
i have made python script wherein process big html beautifulsoup while build tree using treelib: http://xiaming.me/treelib/. have found library comes methods save tree file on system , parsing json. after this, how can load it? not efficient build same entire tree each run. think can make function parse json tree written file want sure if there exists easy way or not.
thanks in advance
the simple answer
with this treelib, can't.
as in documentation (http://xiaming.me/treelib/pyapi.html#node-objects):
tree.save2file(filename[, nid[, level[, idhidden[, filter[, key[, reverse]]]]]]]) save tree file offline analysis.
it not contain json-parser, can not read files.
what can do?
you have no other option building tree each time every run.
implement json-reader parses file , creates tree you.
Comments
Post a Comment