Page 2 of 2

Re: JSONtoArray() without indexes?

Posted: Tue Mar 22, 2022 4:15 pm
by FourthWorld
Zax wrote: Tue Mar 22, 2022 3:18 pm
FourthWorld wrote: Tue Mar 22, 2022 2:30 pm Would a simple tab-delimited list suffice?
I started with that, but it soon appears that it was not a good way.
Why?

Re: JSONtoArray() without indexes?

Posted: Tue Mar 22, 2022 5:02 pm
by Zax
FourthWorld wrote: Tue Mar 22, 2022 4:15 pm
Zax wrote: Tue Mar 22, 2022 3:18 pm
FourthWorld wrote: Tue Mar 22, 2022 2:30 pm Would a simple tab-delimited list suffice?
I started with that, but it soon appears that it was not a good way.
Why?
Well, I think it's better to have all data result in one formatted line instead of an unknown number of lines, and separated from possible error strings returned by the Python script.

Re: JSONtoArray() without indexes?

Posted: Tue Mar 22, 2022 5:17 pm
by FourthWorld
Zax wrote: Tue Mar 22, 2022 5:02 pm
FourthWorld wrote: Tue Mar 22, 2022 4:15 pm
Zax wrote: Tue Mar 22, 2022 3:18 pm
I started with that, but it soon appears that it was not a good way.
Why?
Well, I think it's better to have all data result in one formatted line instead of an unknown number of lines, and separated from possible error strings returned by the Python script.
It's very rare that data coming over the internet is ensured to be limited to a single line. If that's the only concern I'm curious about what makes the Python delivery script brittle enough for that to be an issue.

Re: JSONtoArray() without indexes?

Posted: Wed Mar 23, 2022 8:24 am
by Zax
No doubt my script is not perfect (I'm new to Python). Also, it can return debugging informations with an unknown number of lines, so it seemed to me that the cleanest way to return valid data was in JSON format.

Re: JSONtoArray() without indexes?

Posted: Wed Mar 23, 2022 12:02 pm
by Zax
stam wrote: Mon Mar 21, 2022 8:33 am FerrusLogic have shared their own parser PhotonJSON as free/opensource.
Just tried PhotoJSON: it works fine and more flexible than JSONToArray :)

Re: JSONtoArray() without indexes?

Posted: Wed Mar 23, 2022 7:04 pm
by FourthWorld
Zax wrote: Wed Mar 23, 2022 12:02 pm
stam wrote: Mon Mar 21, 2022 8:33 am FerrusLogic have shared their own parser PhotonJSON as free/opensource.
Just tried PhotoJSON: it works fine and more flexible than JSONToArray :)
Excellent. Good find. Glad you have a solution in hand.

Re: JSONtoArray() without indexes?

Posted: Wed Mar 23, 2022 8:15 pm
by stam
Zax wrote: Wed Mar 23, 2022 12:02 pm Just tried PhotoJSON: it works fine and more flexible than JSONToArray :)
Glad to hear it’s useful - don’t forget to give them a star on GitHub in way of thanks! I’ll definitely check it out when I have need of JSON…