I'm a newb trying to figure out how to accomplish the following:
I have dicts named after users in the following format:
<user>_hx
I want to access them with a function like so:
def foo(user, other_stuff):
user_hx[key]
......etc.
I attempted to access with % as follows:
def foo(user, other_stuff):
%r_hx %user[key]
but for obvious reasons I know that can't work.
Adivce?
eval(user+'_hx'), although eval is not recommended"%s_hx"%user[key]? you open a file withopen(filename,fileMode)