摘要: import requests def gethtmltext(url): try: r=requests.get(url,timeout=30) r.raise_for_status() r.encoding='utf-8' return r.text except: return "" url= 阅读全文
posted @ 2020-12-13 23:13 Zhhou 阅读(89) 评论(0) 推荐(0)
摘要: numpy基本函数 scipy pandas numpy的导入 使用用例 import numpy as np import numpy as np print np.random.rand(4,4) >>> import numpy as np #生成数据 >>> x=np.arange(10) 阅读全文
posted @ 2020-11-20 10:54 Zhhou 阅读(96) 评论(0) 推荐(0)
摘要: print("乒乓球比赛,学号11") from random import random def printInfo(): # 打印程序介绍信息 print('这个程序模拟两个选手A和B的某种竞技比赛') print('程序运行需要A和B的能力值(以0到1之间的小数表示)') def getInp 阅读全文
posted @ 2020-11-18 21:44 Zhhou 阅读(97) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-11-13 16:03 Zhhou 阅读(85) 评论(0) 推荐(0)
摘要: import jieba def takeSecond(elem): return elem[1] def main(): path = "西游记.txt" file = open(path,"r",encoding="utf-8") text=file.read() file.close() wo 阅读全文
posted @ 2020-11-13 15:55 Zhhou 阅读(146) 评论(0) 推荐(0)
摘要: from random import random from time import perf_counter import time from tqdm import tqdm scale = 50 print("执行开始".center(scale//2, "-")) start = time. 阅读全文
posted @ 2020-10-19 19:12 Zhhou 阅读(138) 评论(0) 推荐(0)
摘要: import turtle as t import time def popspace(): t.penup() t.fd(5) def popline(draw): popspace() t.pendown() if draw else t.penup() t.fd(40) popspace() 阅读全文
posted @ 2020-10-19 18:54 Zhhou 阅读(229) 评论(0) 推荐(0)
摘要: import turtle def drawSnake(rad, angle, len, neckrad): for _ in range(len): turtle.circle(rad, angle) turtle.circle(-rad, angle) turtle.circle(rad, an 阅读全文
posted @ 2020-09-21 18:49 Zhhou 阅读(109) 评论(0) 推荐(0)
摘要: import turtle as t t.setup(650,350,200,200) t.pu() t.fd(50) t.left(-90) t.fd(100) t.right(90) t.pd() t.pensize(5) t.pencolor("black") for i in range ( 阅读全文
posted @ 2020-09-14 20:04 Zhhou 阅读(197) 评论(0) 推荐(0)