文章分类 -  python

摘要:1、安装pyqt和PyQt-tools,注意:需要保证两个包的版本一致 pip install pyqt6 PyQt6-tools 2、实验Qt Designer设计的ui文件,如新建一个test.ui文件 3、切换到你保存ui的目录,然后使用命令将test.ui转换成py文件,转换成功后即可在py 阅读全文
posted @ 2024-04-26 11:23 平平无奇小辣鸡 阅读(1580) 评论(0) 推荐(0)
摘要:1、第一步安装 pip install pyinstaller 2、进入你要打包的文件输入打包命令 #建议打包方式 pyinstaller -w helloworld.py #打包成单独exe文件启动速度慢 pyinstaller -wF helloworld.py 其中,-F 表示打包成单独的 . 阅读全文
posted @ 2020-03-20 10:55 平平无奇小辣鸡 阅读(199) 评论(0) 推荐(0)
摘要:tornado web server 是一个用python写的web服务器兼Python web应用框架,Tornado可以支撑上万级的连接, 处理 长连接, WebSockets ,和其他需要与每个用户保持长久连接的应用. epoll 可以管理socket,totnado是基于epoll来实现高并 阅读全文
posted @ 2019-08-04 12:10 平平无奇小辣鸡 阅读(144) 评论(0) 推荐(0)
摘要:https://selfboot.cn/2016/06/13/python_performance_analysis/ 阅读全文
posted @ 2019-07-13 20:59 平平无奇小辣鸡 阅读(228) 评论(0) 推荐(0)
摘要:import random import time def shuffle1(): """ 算法思路:将54张牌编号为有顺序的列表,通过rendom.shuffle方法实现编号乱并返回list :return: item顺序打乱后的列表 """ item = [i for i in range(10000)] random.shuffle(it... 阅读全文
posted @ 2019-07-08 22:17 平平无奇小辣鸡 阅读(224) 评论(0) 推荐(0)
摘要:def cal_time(func): def wrapper(*args, **kwargs): t1 = time.time() result = func(*args, **kwargs) t2 = time.time() print("%s running time: %s secs." % (func.__name... 阅读全文
posted @ 2019-07-08 19:19 平平无奇小辣鸡 阅读(107) 评论(0) 推荐(0)
摘要:1、安装json5的python包 2、新建test.json文件 3、用jison5反序列化数据 阅读全文
posted @ 2019-06-19 15:33 平平无奇小辣鸡 阅读(3585) 评论(0) 推荐(0)
摘要:pip install https://codeload.github.com/sshwsfc/xadmin/zip/django2 阅读全文
posted @ 2019-06-18 21:22 平平无奇小辣鸡 阅读(110) 评论(0) 推荐(0)
摘要:virtualenv 常用命令 virtualenvwrapper 阅读全文
posted @ 2019-05-31 20:38 平平无奇小辣鸡 阅读(117) 评论(0) 推荐(0)
摘要:这是因为外键导致的错误,这时候需要你找到表中对应的外键并写道对应的版本中 阅读全文
posted @ 2019-05-31 19:17 平平无奇小辣鸡 阅读(2898) 评论(0) 推荐(0)
摘要:依赖包安装 flask代码 阅读全文
posted @ 2019-05-30 22:21 平平无奇小辣鸡 阅读(150) 评论(0) 推荐(0)
摘要:自定制一个分页类 阅读全文
posted @ 2019-04-17 21:57 平平无奇小辣鸡 阅读(121) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-03-08 16:52 平平无奇小辣鸡 阅读(131) 评论(0) 推荐(0)
摘要:import time for i in range(0, 101, 2): time.sleep(0.1) char_num = i//2 # 打印多少个'*' per_str = '\r%s%% : %s\n' % (i, '*' * char_num) if i == 100 else '\r%s%% : %s' % (i, '*'*char_num) ... 阅读全文
posted @ 2019-02-04 10:33 平平无奇小辣鸡 阅读(75) 评论(0) 推荐(0)
摘要:server端 client端 阅读全文
posted @ 2019-01-31 16:20 平平无奇小辣鸡 阅读(246) 评论(0) 推荐(0)
摘要:不开协程 开协程 阅读全文
posted @ 2019-01-31 16:08 平平无奇小辣鸡 阅读(210) 评论(0) 推荐(0)
摘要:用gecent模块实现函数之间的切换 阅读全文
posted @ 2019-01-31 15:53 平平无奇小辣鸡 阅读(136) 评论(0) 推荐(0)
摘要:import time import greenlet # 完成两个函数之间的互相切换 def eat(): print('eat1') time.sleep(1) g2.switch() print('eat2') g2.switch() def sleep(): print('sleep1') g1.switch() t... 阅读全文
posted @ 2019-01-29 16:10 平平无奇小辣鸡 阅读(185) 评论(0) 推荐(0)
摘要:用yield实现两个函数之间的切换 阅读全文
posted @ 2019-01-29 16:08 平平无奇小辣鸡 阅读(210) 评论(0) 推荐(0)
摘要:用concurrent.futures模块开一个线程池 map方法 用concurrent.futures模块开一个进程池 使用result获取子线程中的返回值 使用回调函数来处理子线程中代码的执行结果 阅读全文
posted @ 2019-01-29 15:08 平平无奇小辣鸡 阅读(247) 评论(0) 推荐(0)