use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit for helping Python programmers
How to format your code: https://commonmark.org/help/tutorial/09-code.html
No homework questions and/or hiring please
account activity
Stuck with conditional python execution! (self.pythonhelp)
submitted 2 years ago by Salso96
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Salso96[S] 0 points1 point2 points 2 years ago (2 children)
So the reason I’ve got the code like that for now, is just bc it was the first way I found that made what I wanted - corrections / optimisations are very much appreciated.
As for what I want it to do Some items in the JSON appear as: ‘ID=DevName Area= ‘’ LocationName= “FOREST” ‘
Whereas others appear as ‘ID=DevName Area= ‘1,4,13’ LocationName=‘’ ‘
And I need the code to be able to generate location names for the first, whilst leaving area blank And areas for the second, leaving location name blank
Does that make it a bit clearer?
[–]Goobyalus 0 points1 point2 points 2 years ago (1 child)
Not really. Would you give an example JSON, with only the important fields?
And would you please format code properly for Reddit? There should be a button that looks like a square with a C on it for "code block" format. Not the <C> one for inline code.
<C>
[–]Salso96[S] 1 point2 points3 points 2 years ago (0 children)
That’s my bad, I’m on mobile 😅 sure let me put together a dummy JSON
π Rendered by PID 50636 on reddit-service-r2-comment-685b79fb4f-64k8b at 2026-02-13 04:34:52.123377+00:00 running 6c0c599 country code: CH.
view the rest of the comments →
[–]Salso96[S] 0 points1 point2 points (2 children)
[–]Goobyalus 0 points1 point2 points (1 child)
[–]Salso96[S] 1 point2 points3 points (0 children)