如何监控python中的变量?
问题描述:
我有一个简单的python烧瓶项目,我需要在发生任何操作之前有一个用户确认。如何监控python中的变量?
...
#need to confirm from the user before the action takes place. If it is yes, continue with action(), else skip action
#I need to keep monitoring the confirm_var here
action()
...
从用户获得确认后,我打电话这种confirmation()
功能设置使用AJAX调用confirm_var。
def confirmation()
#set confirm_var to yes/no depending on user input.
所以,我的问题是如何继续监测confirm_var
。