.DokiDoki

导航

2020年12月14日 #

python html页面

摘要: from bs4 import BeautifulSoup import re soup=BeautifulSoup('''<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鸟教程(runoob.com)</title> </h 阅读全文

posted @ 2020-12-14 19:41 .DokiDoki 阅读(82) 评论(0) 推荐(0) 编辑

python 爬虫goole主页

摘要: import requests url="https://www.google.cn/" def gethtml(url): try: r=requests.get(url) r.raise_for_status() r.encoding="utf-8" print("text内容:",r.text 阅读全文

posted @ 2020-12-14 19:13 .DokiDoki 阅读(85) 评论(0) 推荐(0) 编辑

2020年11月23日 #

python 足球模拟

摘要: # 比赛规则: # 1. 比赛分为两场,每场为45分钟 # 上半场: 一方挑选进攻的球门,另一方获得开球权 # 下半场: 互换攻守方向,上半场没获得开球权的一方获得开球权 # 2. 在进球后开球时,开球方为失球一方 # 3. 在没有违反任何比赛规则时,进攻球队得分。 # 4. 比赛结束时得分多的球队 阅读全文

posted @ 2020-11-23 18:55 .DokiDoki 阅读(271) 评论(0) 推荐(0) 编辑

python模拟羽毛球竞技

摘要: from random import random #第一阶段 def printIntro(): print("模拟两个选手A和B的羽毛球比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)") def getInputs(): a = eval(input("请输入选手A 阅读全文

posted @ 2020-11-23 18:52 .DokiDoki 阅读(126) 评论(0) 推荐(0) 编辑

2020年11月22日 #

python 读书报告

摘要: NumPy篇 numpy.around() 函数返回指定数字的四舍五入值 numpy.floor() numpy.floor() 返回小于或者等于指定表达式的最大整数,即向下取整 numpy.ceil() numpy.ceil() 返回大于或者等于指定表达式的最小整数,即向上取整 numpy.rec 阅读全文

posted @ 2020-11-22 23:43 .DokiDoki 阅读(306) 评论(0) 推荐(0) 编辑

python 用jieba分词统计关于红楼梦的高频词

摘要: import jieba excludes = {"什么","一个","我们","那里","你们","如今","说道","知道","起来","姑娘","这里","出来","他们","众人","自己", "一面","只见","怎么",&quo 阅读全文

posted @ 2020-11-22 21:30 .DokiDoki 阅读(496) 评论(0) 推荐(0) 编辑

2020年10月26日 #

python 在终端输出如下信息

摘要: 在终端输出如下信息‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬ 小明,10岁,男,上山去砍柴 小明,10岁,男,开车去东北 小明,10岁,男,最爱打游戏 阅读全文

posted @ 2020-10-26 19:26 .DokiDoki 阅读(243) 评论(0) 推荐(0) 编辑

2020年10月18日 #

python 画出,系统时间。具体包括:小时,分,秒

摘要: import turtle, datetime def drawGap(): turtle.up() turtle.fd(5) def drawLine(draw): drawGap() if(draw): turtle.down() else: turtle.up() turtle.fd(40) 阅读全文

posted @ 2020-10-18 23:09 .DokiDoki 阅读(287) 评论(0) 推荐(0) 编辑

2020年9月21日 #

python绘制玫瑰花

摘要: import turtle # 设置初始位置 turtle.penup() turtle.left(90) turtle.fd(200) turtle.pendown() turtle.right(90) # 花蕊 turtle.fillcolor("red") turtle.begin_fill( 阅读全文

posted @ 2020-09-21 19:58 .DokiDoki 阅读(1048) 评论(0) 推荐(0) 编辑

python画小猪佩奇

摘要: 1 import turtle as t 2 3 4 def init_pen(): 5 ''' 6 初始化画笔的一些属性 7 ''' 8 t.pensize(4) # 设置画笔的大小 9 t.colormode(255) # 设置GBK颜色范围为0-255 10 t.color((255, 155 阅读全文

posted @ 2020-09-21 19:44 .DokiDoki 阅读(178) 评论(0) 推荐(0) 编辑