摘要: 一闪而过可能是程序出错,导致的 .py 文件导入的文件,使用相对路径 在导包成 exe 文件时 将使用到的文件放入到 同一文件夹内 即可运行 另外,程序一闪而过 可以考虑使用 time.sleep(30) 方法 2020-05-27 阅读全文
posted @ 2020-05-27 22:05 Hany47315 阅读(174) 评论(0) 推荐(0)
摘要: import re pattern = '\d+?\.\d+' s = "[Decimal('90.900000')]" s2 = "[Decimal('75.900000'),Decimal('57.280000')]" [print(i,end = " ") for i in re.findal 阅读全文
posted @ 2020-05-27 12:16 Hany47315 阅读(241) 评论(0) 推荐(0)
摘要: import random def no_change(times): glass_ball = 0 diamond = 0 times2=times while times>0: drawers={'drawer1': False, 'drawer2': False, 'drawer3': Fal 阅读全文
posted @ 2020-05-27 11:03 Hany47315 阅读(169) 评论(0) 推荐(0)
摘要: import numpy as np import pandas as pd import matplotlib.pyplot as plt cqlq=pd.read_csv("cqlq.txt",sep="\s+",encoding="gbk") dxnt=pd.read_csv("dxnt.tx 阅读全文
posted @ 2020-05-27 10:58 Hany47315 阅读(181) 评论(0) 推荐(0)
摘要: def predict(train_samples,X): #描述属性分别用数字代替 #年龄: <=30:0, 30~40:1, <40:2 #收入:‘低’:0,'中':1,'高':2 #是否学生:‘是’:1,'否':1 #信誉: '中':0,'优':1 #购买属性用数字代替 #购买电脑 :‘是’: 阅读全文
posted @ 2020-05-27 10:56 Hany47315 阅读(149) 评论(0) 推荐(0)
摘要: import sqlite3 conn = sqlite3.connect('studentsdb.db') # 连接数据库 cursor = conn.cursor( ) # 创建数据表 def createDatabase(): '''创建一个数据表''' sql = 'create table 阅读全文
posted @ 2020-05-27 10:54 Hany47315 阅读(459) 评论(0) 推荐(0)
摘要: import pandas as pd import numpy as np import matplotlib.pyplot as plt cqlq = pd.read_excel("cqlq.xls",sep='\s+') dxnt = pd.read_excel("dxnt.xls",sep= 阅读全文
posted @ 2020-05-27 10:53 Hany47315 阅读(147) 评论(0) 推荐(0)