import ui
from time import *
start = int(time())
def stop_time(sender):
finish = int(time())
total_time = int(finish - start)
button1 = str("Your time is %i seconds." % (total_time))
sender.title = None
sender.title = str(button1)
如何允许重新启动按钮更改启动变量?
def restart_time(sender):
start = int(time())
button2 = str("Stopwatch restarted.")
sender.title = None
sender.title = str(button2)
ui.load_view('stop_time').present('sheet')