Answer the question
In order to leave comments, you need to log in
How to sort an object with a nested struct Python?
There is such an object
obj = {"farm": {"name": "farm", "count": 7}, "underwater": {"name": "underwater", "count": 5}, "pink": {"name": "pink", "count": 2}, "beach": {"name": "beach", "count": 2}, "park": {"name": "park", "count": 1}, "zoo": {"name": "zoo", "count": 1}, "blue": {"name": "blue", "count": 1}}
def byCount(prop):
print(prop)
# el тут как раз и не понятно как получить
return obj[prop][el]['count']
result = sorted(obj, key=byCount)
Answer the question
In order to leave comments, you need to log in
As far as I know, PHP build-in webserver does not support this.
Your cure
https://github.com/wandenberg/nginx-push-stream-module
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question