Converting string to argument

Laughlin, Joseph V Joseph.V.Laughlin at boeing.com
Fri Jul 2 03:07:16 CEST 2004



class Foo:
	x = "blah"
	y = "blah some more"

foo = Foo()
x_string = "x"
y_string = "y"

# I want something like this to work:
print foo.x_string
print foo.y_string
# The above should print out "blah" and "blah some more"
# Any ideas?
# Let me know if I need to clarify anything.




Joe Laughlin
NCO Simulation Labs
Integrated Defense Systems
The Boeing Company







More information about the Python-list mailing list