摘要: import random print( random.randint(1,10) ) # 产生 1 到 10 的一个整数型随机数 print( random.random() ) # 产生 0 到 1 之间的随机浮点数 print( random.uniform(1.1,5.4) ) # 产生 1 阅读全文
posted @ 2020-09-14 15:20 短戈行 阅读(161) 评论(0) 推荐(0) 编辑
摘要: f=open("D:/test/test1.txt","r",encoding="utf-8") # f=open("D:\\test\\test1.txt","r",encoding="utf-8") # file 是文件路径,mode 是文件打开模式,encoding 是编码模式 # 'r' 只 阅读全文
posted @ 2020-09-14 01:43 短戈行 阅读(280) 评论(0) 推荐(0) 编辑
摘要: pymysql库连接 pandas读 # pymysql 是在 python3.x 版本中用于连接 MySql 服务器的一个库 # 1.创建一个连接对象 # host mysql 服务器地址 # port 数字类型 端口 # user 用户名 # passwd 密码 # db 数据库名称 # cha 阅读全文
posted @ 2020-09-14 01:32 短戈行 阅读(3216) 评论(0) 推荐(0) 编辑