时间:2021-07-01 10:21:17 帮助过:39人阅读
def VerifyInt(data):
assert(int(data) > 0)
def VerifyString(data):
assert(len(data) > 10)
def inner(*args, **kvargs):
print args
print kvargs
assert(len(args) > 1)
if args[1] == "int.txt":
VerifyInt(args[0])
elif args[1] == "string.txt":
VerifyString(args[0])
func(*args, **kvargs)
return inner
@VerifyData
def WriteData(text, filepath):
print "WriteData"
print text
print filepath
WriteData("1234567890", "int.txt")