Find out the name of a variable passed as an argument

  • Thread starter Andreas Huesgen
  • Start date
A

Andreas Huesgen

Hello everybody,

is there a way to receive the name of an object passed to a function
from within the function.

something like

def foo(param):
print theNameOfTheVariablePassedToParam

var1 = "hello"
var2 = "world"
var2

thanks in advance,

greets

Andreas Huesgen
 
J

John Henry

Algol, anyone?


Andreas said:
Hello everybody,

is there a way to receive the name of an object passed to a function
from within the function.

something like

def foo(param):
print theNameOfTheVariablePassedToParam

var1 = "hello"
var2 = "world"

var2

thanks in advance,

greets

Andreas Huesgen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top