using & with lambda on a button works, but outputs error.

时间:2015-05-12 22:16:52

标签: python-3.x tkinter

i need a button to call two functions. the way i have it written right now works, however it outputs the desired text + "TypeError: unsupported operand type(s) for &: 'NoneType' and 'NoneType'"

is there a way to have a button call two functions(it would be hard to combine them into one) with or without lambda that wont produce this error?

sample of problem:

animatedWithDuration:animations:completion:

1 个答案:

答案 0 :(得分:0)

Just create a function that dalls the other two function, there's simply jo reason not to. Lambdas aren't designed for complex operations. Except in rare circumstances, it is best to have buttons directly call functions.