![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python学习笔记
罗军全栈Game
全栈游戏开发 曾经是美术。
展开
-
python语言程序基础习题5.3
def isNum(str): try: if type(eval(str)) in {int,float,complex}: x = True except: x = False print(x)while True : str = input("请输入") isNum(str)这里try-...原创 2020-01-13 15:40:27 · 547 阅读 · 0 评论 -
python 笔记之 使用time库 与 datetime库 实现计时功能
先看代码如下:from datetime import datetimeimport timet1 = datetime.now()t0 = time.perf_counter()while True: delta0 = time.perf_counter() - t0 delta1 = datetime.now() - t1 print ("\r{:.2f} ...原创 2020-01-12 21:48:24 · 2430 阅读 · 0 评论 -
python笔记 之 3.8下time.clock()引用出错的问题
本菜鸟今天学到时间记录,于是尝试使用time.clock()函数记录时间:原代码如下:import timet = time.clock()while True t0 = time.clock() - t print ("\r{:.2f}".format(t0),end="") time.sleep(0.5)但是显示出错了!错误提示如下, 表示time库中...原创 2020-01-12 21:32:43 · 12428 阅读 · 4 评论