> Can you use strings or %s strings like in the above or > > aaa = 'string' > aaa.%s() % 'upper' > > Somehow?
Looks like you want to play with the eval() function. >>> aaa = 'hello' >>> result = eval("aaa.%s()" % 'upper') >>> result 'HELLO' Works for your second example. May work on your first example too. -tkc -- http://mail.python.org/mailman/listinfo/python-list