12 2023 档案

摘要:import pygameimport sysimport random# 素材参考地址:https://www.aigei.com/s?q=flappy+bird&type=2d class Bird(object): """定义一个鸟类""" def __init__(self): """定义初 阅读全文
posted @ 2023-12-26 22:41 Longestriver 阅读(20) 评论(0) 推荐(0)
摘要:import jieba txt = open("聊斋志异白话简写版.txt", "r", encoding='utf-8').read()words = jieba.lcut(txt) # 使用精确模式对文本进行分词counts = {} # 通过键值对的形式存储词语及其出现的次数 for wor 阅读全文
posted @ 2023-12-20 10:24 Longestriver 阅读(14) 评论(0) 推荐(0)
摘要:import requestsurl="https://www.so.com/?src=so.com"def getHTMLText(url): try: r=requests.get(url) r.raise_for_status() r.encoding="utf-8" print("text: 阅读全文
posted @ 2023-12-13 10:18 Longestriver 阅读(11) 评论(0) 推荐(0)