Skip to content

How to get key values in a json object(Python)

This is my json : I want to get a list of all the values of name. What should be my code in python Answer d.values gives all the values, then you can get the attribute name of each value. Also note that d.values returns a generator and not a list so to convert to list use list(d.values())

Python IndexError after 2800 iterations

For some reason that I don’t get, after calling this for the 2800th time (aprox), it gets into the except part. I’m using this to parse a chat log for easier processing later on a Twitch chat bot, so I have to call the parser a lot of times for it to be updated. Can anyone help? Thanks in advance!

Django: create endpoint for a file

I have a mesh.obj file and I would like to create an endpoint for it. For example, the endpoint could be of the form ‘path/to/mesh’. How would I do this? Answer In your urls.py: In your views.py:

Unittest is throwing an error Empty suite

Python is throwing an error ‘Empty suite’ when I test my code. The strange thing is when I run Then this will work, however when I run the actual test for my code This will throw me like : I guess it’s not an issue with unittest but only my code. Source code itself is working fine when I run