On Mon, Jul 11, 2016 at 10:52 PM, MG <m.gamb...@gmail.com> wrote: > Ciao, > I have this function: > > > def lockup_info(refer): > info = [] > amb = CONN.db.xxxx.find({"reference": refer} > for a in amb: > print a > > > > How can I pass this value { "$exists": False } and tell python to not > consider it as a string? > > var = '{ "$exists": False }' > lockup_info(var) > > > > The code above doesn't work. A variable so defined is considered a string.
What do you want it to be, if not a string? Do you want to pass a dictionary? Then do - just pass it in directly. (Side point: I think you mean "lookup_info", not "lockup_info".) ChrisA -- https://mail.python.org/mailman/listinfo/python-list