vendredi 24 mars 2017

Get local name of variable issued to function

want to get name of variable issued from outside.

For example:

def process(var):
  print name(var)#prints 'nice_name'

nice_name=1
process(nice_name)

Is it even possible in python?





Aucun commentaire:

Enregistrer un commentaire