How to make a timer program in Python

前端 未结 11 2248
予麋鹿
予麋鹿 2021-02-08 14:24

Here is my goal: To make a small program (text based) that will start with a greeting, print out a timer for how long it has been since the last event, and then a timer for the

11条回答
  •  时光说笑
    2021-02-08 15:07

    This seems like it would be MUCH easier:

    #!/usr/bin/env python
    from datetime import datetime as dt
    starttime = dt.now()
    input("Mark end time")
    endtime = dt.now()
    print("Total time passed is {}.".format(endtime-starttime))
    

提交回复
热议问题