I'm looking for a way that convert all my outputs of a program (that I don't know what the types of them is) to dictionary... I think about a solution like this:
if type(body) != dict:
body = {'result': body}
I know it is wrong! Is there any way that if the type of a variable was not dictionary, ourselves make a dictionary with that ?!