Hi,
I am trying to save input as a .json, but for some reason json.dump cant handle nested arrays?
IN[1] is the data im saving as a json array, below the python script the preview is shown thats the loaded json file.
When i add a nested list as a value this breaks and it doesnt save the data correctly:
As far as i can tell a nested array should be a valid type, or am i mistaken?
Have you tried using the StringifyJSON node from Dynamo instead?
That works, but I would like to be able to just supply a list to the python node instead of having to use a stringify.json node beforehand
If i turn this into a custom node however i could just use the stringify json node in there… That works
Out of curiosity i do wonder why i can’t just do json.dump similar to JSON.stringify in javascript…
You can, but you’re missing a few bits of memory serves, and I am not at a PC to test (2 week holiday). You can try googling the error as this type of Python function is not unique to Dynamo you’re apt to get a solution via stack exchange, geeks for geeks, or stack overflow post. You can also look into the code in the zip posted below as I recall that does a bunch with the JSON module.
That’s the ‘work’ account which exists solely because it has to, and since I had info I thought might keep you hopeful I wanted to share it out before you got discouraged.
First some background.
Managing Dynamo repositories is hard, as each release can require modifying your code base, similar to what developers of add-ins go through. However we (development, seasoned users, community leaders) haven’t done a good job showing how this is best accomplished. My small section of this class aimed t…
1 Like