摘要: import requests url="https://http://www.zuihaodaxue.com/zuihaodaxuepaiming2018.html/" def gethtml(url): try: r=requests.get(url) r.raise_for_status() 阅读全文
posted @ 2020-12-14 19:22 pchhhh-/ 阅读(62) 评论(0) 推荐(0)
摘要: 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 18:59 pchhhh-/ 阅读(135) 评论(0) 推荐(0)
摘要: import requests url="https://www.baidu.com/" def gethtml(url): try: r=requests.get(url) r.raise_for_status() r.encoding="utf-8" print("text内容:",r.text 阅读全文
posted @ 2020-12-14 18:52 pchhhh-/ 阅读(130) 评论(0) 推荐(0)
摘要: NumPy篇 numpy.around() 函数返回指定数字的四舍五入值 numpy.floor() numpy.floor() 返回小于或者等于指定表达式的最大整数,即向下取整 numpy.ceil() numpy.ceil() 返回大于或者等于指定表达式的最小整数,即向上取整 numpy.rec 阅读全文
posted @ 2020-11-22 21:59 pchhhh-/ 阅读(47) 评论(0) 推荐(0)
摘要: from random import random def printIntro(): #打印程序介绍信息 print("12号朱益民进行比赛分析结果:") print("这个程序模拟两个队伍A和B的某种竞技比赛") print("程序运行需要队伍A和队伍B的能力值(以0到1之间的小数表示)") d 阅读全文
posted @ 2020-11-22 21:57 pchhhh-/ 阅读(167) 评论(0) 推荐(0)
摘要: import jieba txt = open("西游记.txt", "r", encoding='utf-8').read() words = jieba.lcut(txt) # 使用精确模式对文本进行分词 counts = {} # 通过键值对的形式存储词语及其出现的次数 for word in 阅读全文
posted @ 2020-11-15 10:52 pchhhh-/ 阅读(95) 评论(0) 推荐(0)
摘要: def kanchai(name, age, gender): print "%s,%s岁,%s,上山去砍柴" %(name, age, gender) def qudongbei(name, age, gender): print "%s,%s岁,%s,开车去东北" %(name, age, ge 阅读全文
posted @ 2020-10-26 18:57 pchhhh-/ 阅读(60) 评论(0) 推荐(0)
摘要: 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 20:42 pchhhh-/ 阅读(85) 评论(0) 推荐(0)
摘要: #CalPiv2.py 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 阅读全文
posted @ 2020-10-11 09:08 pchhhh-/ 阅读(155) 评论(0) 推荐(0)
摘要: from selenium import webdriver from selenium.webdriver import ActionChains browser=webdriver.Chrome() url='http://www.runoob.com/try/try.php?filename= 阅读全文
posted @ 2020-09-21 20:03 pchhhh-/ 阅读(509) 评论(0) 推荐(0)