摘要: import requests r=requests.get("http://www.baidu.com",timeout=30) r.encoding='utf-8' r.raise_for_status() for i in range(20): print(i) print("函数测试输出:\ 阅读全文
posted @ 2020-12-13 21:51 dt_1005 阅读(91) 评论(0) 推荐(0)
摘要: from bs4 import BeautifulSoup html=BeautifulSoup("<!DOCTYPE html>\n<html>\n<head>\n<meta charset=‘utf-8‘>\n<title>菜鸟教程(runoob.com)</title>\n</head>\n< 阅读全文
posted @ 2020-12-13 21:40 dt_1005 阅读(100) 评论(0) 推荐(0)
摘要: import requests r=requests.get("http://www.baidu.com",timeout=30) r.encoding='utf-8' r.raise_for_status() for i in range(20): print(i) print("函数测试输出:\ 阅读全文
posted @ 2020-12-13 21:19 dt_1005 阅读(43) 评论(0) 推荐(0)
摘要: from random import random def printIntro(): print("这个程序模拟两个选手A和B的兵乓球比赛") print("程序运行需要A和B选手的能力值(以0到1之间的小数表示)") def getInput(): probA=eval(input("请输入选手 阅读全文
posted @ 2020-11-16 20:05 dt_1005 阅读(81) 评论(0) 推荐(0)
摘要: from random import random def printIntro(): print("这个程序模拟两个选手A和B的兵乓球比赛") print("程序运行需要A和B选手的能力值(以0到1之间的小数表示)") def getInput(): probA=eval(input("请输入选手 阅读全文
posted @ 2020-11-16 20:03 dt_1005 阅读(41) 评论(0) 推荐(0)
摘要: import jieba txt = open("D:\\西游记.txt", "r", encoding='gb18030').read() words = jieba.lcut(txt) counts = {} for word in words: if len(word) == 1: conti 阅读全文
posted @ 2020-11-14 12:25 dt_1005 阅读(89) 评论(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, g 阅读全文
posted @ 2020-10-26 19:42 dt_1005 阅读(113) 评论(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) 阅读全文
posted @ 2020-10-17 19:32 dt_1005 阅读(89) 评论(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-09 21:29 dt_1005 阅读(64) 评论(0) 推荐(0)
摘要: import turtle as t t.pencolor("red") t.fd(200) t.seth(120) t.fd(200) t.seth(-120) t.fd(200) t.seth(0) t.fd(100) t.seth(60) t.fd(100) t.seth(180) t.fd( 阅读全文
posted @ 2020-09-14 22:04 dt_1005 阅读(126) 评论(0) 推荐(0)