[Tutor] lambdas

Conrad Koziol arkamir at softhome.net
Sat Dec 27 15:35:05 EST 2003


How do you make a lambda expression that returns the time??

I got this 

>>> lambda time: '%s-%s-%s: %s.%s:%s' % (time[0], time[1], time[2],
time[3], time[4], time[5], time[6]), (time.localtime(time.time()))

which returns this, which is not what I want.

(<function <lambda> at 0x8a2791c>, (2003, 12, 27, 12, 30, 20, 5, 361,
0))

i need something like 2003-15-03 1.45:45
How would I do this?? Also how do I get rid of this part:
<function <lambda> at 0x8a2791c>
because i get an error message(too many arguements) when passing it to a
function like this:

def test(hello):
	print hello






More information about the Tutor mailing list