Skip to content

Tag: python

python – json , how to make a json flat

so i have a nested json that contains two groups , each group has a field that contains more sub groups i would like to pop all the sub groups out to flatten the json and remove the sub groups field What is the correct way to do it JSON : This is the expected result: I need to pop

Extract specific value from JSON with Python

I am trying to get all the websites from this json file Unfortunately, when I use this code: I get following error: Any help is appreciated. Thank you in advance Answer Use raw data to get raw json and then iterate over ‘tokens’ attr of the response object:

generated empty [i] in for loop

I want to create an empty set up to the value n entered by the user and assign the values in the for loop into this set. But for this, it is necessary to create as many for loops as the user inputs, it is not possible to do this. How can I do it? The code below works correctly,