摘要: 这是代码:: # -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ # 导入模块 from wxpy import Bot import openpyxl from pyecharts impor 阅读全文
posted @ 2019-06-05 17:00 hy120040 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 1、Python MongoDB MongoDB 是目前最流行的 NoSQL 数据库之一,使用的数据类型 BSON(类似 JSON)。 MongoDB 数据库安装与介绍可以查看我们的 MongoDB 教程。 2、SQLite - Python 安装 SQLite3 可使用 sqlite3 模块与 P 阅读全文
posted @ 2019-05-29 22:10 hy120040 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 1、完善球赛数据 这是代码: 输入(17,11)时,输出True,比赛结束。 这是运行结果: 记录。。。。 阅读全文
posted @ 2019-05-22 22:40 hy120040 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 1. 简介: 模拟不同的两个队伍进行排球的模拟比赛。 2. 模拟原理: 通过输入各自的能力值(Ⅰ),模拟比赛的进行( P ),最后输出模拟的结果( O )。 P 简介:通过产生随机数得到每局比赛的难度,若小于能力值则表示赢得本局比赛,反之输掉本局比赛。 3. 规则简介: ① 每场比赛采用 5局3胜制 阅读全文
posted @ 2019-05-15 21:47 hy120040 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 一、文件基本操作 1、打开文件 2、读取文件 3、关闭文件 比较好用的是运用with 好处是可以避免一次错误 二、文件的转换 1、xlsx转换为csv格式 csv:逗号分隔值(Comma-Separated Values,CSV,有时也称为字符分隔值,因为分隔字符也可以不是逗号),其文件以纯文本形式 阅读全文
posted @ 2019-05-04 21:19 hy120040 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Numpy 创建列表 a = [1, 2, 3, 4,5,6,7] a[ : :-1] # reversed a [7, 6, 5, 4, 3, 2, 1] 将列表转换为数组 b = np.array(a) 输出=>array([1, 2, 3, 4, 5]) 数组基本操作 universal fu 阅读全文
posted @ 2019-04-24 21:15 hy120040 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 面向对象三要素是:封装 继承 多态 封装 封装就是事物抽象为类,把对外接口暴露,将实现和内部数据隐藏。 继承 面向对象编程 (OOP) 语言的一个主要功能就是“继承”。继承是指这样一种能力:它可以使用现有类的所有功能,并在无需重新编写原来的类的情况下对这些功能进行扩展。 通过继承创建的新类称为“子类 阅读全文
posted @ 2019-04-17 21:09 hy120040 阅读(219) 评论(0) 推荐(0) 编辑
摘要: pil库的学习总结 #__author:'lwq'#date: 2018/11/15 from PIL import Image,ImageFilter,ImageDraw,ImageFont #####除了缩略图的方法,其他方法都是返回值,需要变量来接收 img = Image.open('2.j 阅读全文
posted @ 2019-04-10 21:26 hy120040 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 首先,通过pip3 install jieba安装jieba库,随后在网上下载《斗破》。 代码如下: import jieba.analyse path = '小说路径' fp = open(path,'r',encoding='utf-8') content = fp.read() try: ji 阅读全文
posted @ 2019-04-03 22:17 hy120040 阅读(128) 评论(0) 推荐(0) 编辑
摘要: import turtle class Stack: def __init__(self): self.items = [] def isEmpty(self): return len(self.items) == 0 def push(self, item): self.items.append( 阅读全文
posted @ 2019-03-27 21:28 hy120040 阅读(386) 评论(0) 推荐(0) 编辑