Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 19054

How to customize output in API?

$
0
0

I am making a simple API using Python and Flask Framework and I am getting the correct output, but the problem with output is that It come in alphabetical order and I want to customize it in specific order.

This is the code I wrote

First part of codeSecond Part of code

Output I am getting

{"alma": None,"close": 1549.6,"date":2015-02-02,"high": 1556.7,"low": 1544.8,"name": "ACC","open": 1554.9,"volume": 1441  }

Output I want

{"name": "ACC","date":2015-02-02,"open": 1554.9,"high": 1556.7,"low": 1544.8,"close": 1549.6,"volume": 1441"alma": None  },

I want to change the Output format but I don't know how to do it, If anyone know pleas tell me.


Viewing all articles
Browse latest Browse all 19054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>