I want a function that can return the variable/object name as str like this :
def get_variable_name (input_variable):
## some codes
>>get_variable
def getvariablename(vara):
for k in globals():
if globals()[k] == vara:
return k
return str(vara)
may work in some instance ...but very subject to breakage... and I would basically never use it in any kind of production code...
basically I cant think of any good reason to do this ... and about a million not to