上传文件至「week12」
This commit is contained in:
22
week12/ex5.py
Normal file
22
week12/ex5.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from continueanyway import ca
|
||||
|
||||
def handleKBI(lmbd):
|
||||
def runlambda(*args,**kwargs):
|
||||
try:
|
||||
return lmbd(*args,**kwargs)
|
||||
except KeyboardInterrupt:
|
||||
print("\nKeyboardInterrupt detected!")
|
||||
return runlambda
|
||||
|
||||
@handleKBI
|
||||
def inputIE(*args,**kwargs):
|
||||
return input(*args,**kwargs)
|
||||
|
||||
def main():
|
||||
l1 = inputIE("pls input sth")
|
||||
print(l1)
|
||||
|
||||
return 0
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user