I have a code in python, that creates a dictionary with some keys and values. But, I need to have the values ordered in same order as they was added. So code
def getdataready():
data = {}
data["cputemp"] = str(getcputemp())
data["cas"] = str(datetime.datetime.now()).replace(" ", "%20")
data["fan"] = str(fanstate())
data["pstemp"] = str(getPStemp())
#there are some more keys added
return data
declares the dictionary and returns it. But when I run the code, the returned dictionary is ordered without any rules (pstemp, cas, cputemp, venkovniteplota, fan, pokojovatelota) How can I order they in the order of declaration(cputemp, cas, fan, pstemp,...)? I need it, because in this order, the dictionary is sended to webserver ( http://parman.moxo.cz/index.php?page=info using wget and dictionary is converted into url and given to PHP as values in $GET) and there is displayed in the same order as it was received and I'd like to have it in this order Thanks.