摘要: 爬取必应网站数据 import requests from lxml import etree url='https://cn.bing.com/' headers = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit 阅读全文
posted @ 2020-12-24 14:44 小伟往往 阅读(381) 评论(0) 推荐(0)
摘要: Numpy: NumPy是Python中科学计算的基础包。它是一个Python库,提供多维数组对象,各种派生对象(如掩码数组和矩阵),以及用于数组快速操作的各种API,有包括数学、逻辑、形状操作、排序、选择、输入输出、离散傅立叶变换、基本线性代数,基本统计运算和随机模拟等等。 NumPy包的核心是  阅读全文
posted @ 2020-11-22 21:59 小伟往往 阅读(37) 评论(0) 推荐(0)
摘要: 原文链接:https://www.cnblogs.com/bpf-1024/p/10854150.html 羽毛球比赛规则 ‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬ 阅读全文
posted @ 2020-11-22 21:43 小伟往往 阅读(100) 评论(0) 推荐(0)
摘要: import jieba def takeSecond(elem): return elem[1] def main(): path = "D:\聊斋\\1234.txt" file = open(path, "r", encoding="gbk") text = file.read() file. 阅读全文
posted @ 2020-11-15 11:41 小伟往往 阅读(81) 评论(0) 推荐(0)
摘要: 在终端输出如下信息,(两种以上方法) ‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬ 描述 练习一:在终端输出如下信息‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬ 阅读全文
posted @ 2020-10-26 19:37 小伟往往 阅读(106) 评论(0) 推荐(0)
摘要: from random import random from time import perf_counter DARTS = 1000 * 1000 hits = 0.0 start = perf_counter() for i in range(1,DARTS+1): x,y = random( 阅读全文
posted @ 2020-10-11 10:46 小伟往往 阅读(102) 评论(0) 推荐(0)
摘要: turtle库是python的基础绘图库 使用turtle的setup函数,可以在屏幕中生成一个窗口(窗体),设置窗体的大小和位置,这个窗口就是画布的范围。 turtle.setup(width,height,startx,starty) 例如生成一个100*100的画布 import turtle 阅读全文
posted @ 2020-09-21 19:33 小伟往往 阅读(173) 评论(0) 推荐(0)
摘要: 1 import turtle 2 turtle.pensize(3) 3 turtle.forward(100) 4 turtle.right(120) 5 turtle.forward(100) 6 turtle.right(120) 7 turtle.forward(100) 8 turtle 阅读全文
posted @ 2020-09-15 19:53 小伟往往 阅读(181) 评论(0) 推荐(0)
摘要: 1 import turtle 2 turtle.setup(650,350,200,200) 3 turtle.penup() 4 turtle.pensize(10) 5 turtle.pencolor("black") 6 turtle.fd(100) 7 turtle.seth(30) 8 阅读全文
posted @ 2020-09-15 19:49 小伟往往 阅读(561) 评论(0) 推荐(0)
摘要: 1 from turtle import * 2 fillcolor("red") 3 begin_fill() 4 while True: 5 forward(200) 6 right(144) 7 if abs(pos()) < 1: 8 break 9 end_fill() 阅读全文
posted @ 2020-09-15 19:46 小伟往往 阅读(119) 评论(0) 推荐(0)