![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Python知识点
介绍Python琐碎知识点
繁星伴晚安
热爱诗和代码
展开
-
【Python】【turtle库】
帮助文档具体操作Python绘制七段数码管 获取并显示当前系统时间原创 2020-12-23 11:21:33 · 93 阅读 · 0 评论 -
【Python】matplotlib
基本用法import matplotlib.pyplot as pltfig = plt.figure() # 先创建一个画板ax1 = fig.add_subplot(221) # 设置i行j列,指定在第k个位置ax1.set(xlim = [0.5,4.5],ylim = [-2,8]) # 设置x轴、y轴范围ax1 = fig.add_subplot(222)ax1.set(xlim = [0.5,4.5],ylim = [-2,8])ax1 = fig.add_subplot(2原创 2020-12-20 08:07:05 · 2064 阅读 · 5 评论 -
【Python】numpy
arange()import numpy as np# arange()返回一个列表x = np.arange(5) #起点默认为0,步长默认为1y = np.arange(2,5) #设置起点为2,终点为4z = np.arange(2,3,0.1) #步长设置为0.1,只有步长支持小数print(x)print(y)print(z)zeros()import numpy as np# 返回一个数组x = np.zeros(5) #参数指定数组长度,数组元素默认为0,元素类型为浮原创 2020-12-19 20:09:23 · 120 阅读 · 1 评论 -
Python注意点
字符串不允许被修改原创 2020-12-19 12:36:16 · 58 阅读 · 1 评论 -
【文件操作】
打开文件读、写文件关闭文件# 1.打开文件file = open("README",encoding='utf-8')# 2.读取文件text = file.read()# 默认返回文件的所有内容print(text)print(len(text))print("-" * 50)text = file.read()# 此时指针移动到文件末尾了print(text)print(len(text))# 3.关闭文件file.close()# 忘记关闭文件会造成系统资源消耗.原创 2020-12-19 15:31:33 · 100 阅读 · 1 评论