if event.key() == Qt.Key_0 or Qt.Key_1:
if event.key() in [Qt.Key_0, Qt.Key_1]:
key = event.key()
if key == Qt.Key_0 or key == Qt.Key_1:
# -*- coding: utf-8 -*-
def print_result(func):
def wrapper(*args, **kwargs):
rc = func(*args, **kwargs)
print('function ' + func.__name__ + ' returns ' + repr(rc))
return rc
return wrapper
@print_result
def a(x=0):
return x, x*x
print('a(2) =', a(2))