stanf 43 Posted December 16, 2016 Report Share Posted December 16, 2016 ---solvednot normaly working with json it did not occur to that every line has a distinct id number.list to list/all items with element = id/list total i want to load json data into a table.how do i determine how many objects in a file? Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted December 16, 2016 Report Share Posted December 16, 2016 You can load a .json file into python.JSON and a python dictionary are pretty much the same. You can dump a python dictionary into a .json file too.Send JSON as well. You can use the "json" module, it comes with ubot's python. google "json python 2" Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted December 16, 2016 Report Share Posted December 16, 2016 you would also want to look uppython dictionaryas well save to file("{$special folder("Desktop")}\\test-json.json","\{ \"args\": \{\}, \"headers\": \{ \"Accept\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\", \"Accept-Encoding\": \"gzip, deflate\", \"Accept-Language\": \"en-US,en;q=0.8\", \"Cookie\": \"_ga=GA1.2.763621291.1481916579; _gat=1\", \"Host\": \"httpbin.org\", \"Referer\": \"http://httpbin.org/\", \"Upgrade-Insecure-Requests\": \"1\", \"User-Agent\": \"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36\" \}, \"origin\": \"111.222.111.00\", \"url\": \"http://httpbin.org/get\" \}") python("","import json jfile = r\"{$special folder("Desktop")}\\test-json.json\" with open(jfile, \'r\') as jf: jread = jf.read() jdict = json.loads(jread)") alert($python result("","len(jdict)")) This is kinda what it may look like.depends on a lot of things CD Quote Link to post Share on other sites
stanf 43 Posted December 16, 2016 Author Report Share Posted December 16, 2016 thanks, ill look into that Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.