随笔分类 - python
摘要:只说打包成单文件——【仅针对win系统】 步骤: 1、写脚本 2、在当前环境下安装pyinstaller 3、打开终端界面【terminal】 (1)切换到当前程序所在路径 (2)运行打包命令: pyinstaller -F xx.py -n newname (3) 打包成功显示如下界面 4、 cm
阅读全文
摘要:1、函数传参 传参是赋值操作 def changdelist(nums): nums.append('c') return nums str1=['a','b'] changdelist(str1) #nums ['a', 'b', 'c'] str1 #['a', 'b', 'c'] # 与不是参
阅读全文
摘要:1.调各种背景:样式美化matplotlib.pyplot.style.use定制画布风格 - 知乎 (zhihu.com) 2.
阅读全文
摘要:迭代--一个接一个地读取列表中值的过程 list1=[1,2,3] for i in list1: print(i,end=' ') # 1 2 3 list2=[x*x for x in range(5)] for i in list2: print(i,end=' ') # 0 1 4 9 16
阅读全文
摘要:数据写入: os.makedirs(os.path.join('..', 'data'), exist_ok=True) data_file1= os.path.join('..', 'data', 'animals.csv') with open(data_file1,'w',encoding='
阅读全文