摘要: 背景: 电脑上同时安装了python2.7和python3.8,现在想用 python3.8环境下的pyinstaller来进行打包生成exe文件。 常规操作方法:通过cmd进入需要打包文件的目录,执行命令 pyinstaller -F -w xx.py 就能进行打包生成exe文件 尝试方法一(失败 阅读全文
posted @ 2022-09-28 10:12 njuptlwh 阅读(722) 评论(0) 推荐(0) 编辑
摘要: 问题描述: 执行pytest时,弹出warning信息 “PytestUnknownMarkWarning: Unknown pytest.mark.measconftest - is this a typo? You can register custom marks to avoid this 阅读全文
posted @ 2022-02-22 10:31 njuptlwh 阅读(299) 评论(0) 推荐(1) 编辑
摘要: 需求背景: 一秒记录一个数据,数据从仪器读取,经过一系列的操作后记录到csv文件(该过程从发命令到成功写入CSV需要的操作时间不等,从几毫秒到几百毫秒),记录时间一天左右! 第一次实现 使用 time.sleep() 1 import time 2 import datetime 3 4 def h 阅读全文
posted @ 2020-11-05 16:11 njuptlwh 阅读(3183) 评论(0) 推荐(0) 编辑
摘要: 背景: 本人用python2.7+pyqt4 写了一个记录仪器log的带界面的小程序,要拿到客户电脑上用,必须要打包成可执行文件才行! 找方法: 网上搜了一下很简单,pyinstaller -F xxx.py 就能生成梦寐以求得可执行文件了 第一步:打开dos,直接输入命令 "pip install 阅读全文
posted @ 2020-10-25 21:36 njuptlwh 阅读(1196) 评论(0) 推荐(1) 编辑
摘要: python 环境:Python 2.7.16 需要安装:pandas/xlrd (pip2 install pandas/ pip2 install xlrd) import pandas as pd def find_row(num_value,file_name): """ Returns t 阅读全文
posted @ 2020-06-09 08:46 njuptlwh 阅读(4955) 评论(0) 推荐(0) 编辑
摘要: # _*_ coding:utf-8 _*_ import socket import time HOST = '169.254.1.1' #8846 IP PORT = 3490 #8846 PORT BUF_SIZE = 1024 ADDR = (HOST,PORT) client = sock 阅读全文
posted @ 2020-05-27 13:08 njuptlwh 阅读(1013) 评论(0) 推荐(0) 编辑
摘要: vs2015工程移到vs2019 提示错误1: MSB8041 MFC libraries are required for this project. ...... 提示错误2: MSB8042 MFC libraries with Spectre Mitigations are. ...... 阅读全文
posted @ 2020-03-10 10:29 njuptlwh 阅读(4915) 评论(0) 推荐(0) 编辑
摘要: https://openpyxl.readthedocs.io/en/latest/tutorial.html https://automatetheboringstuff.com/chapter12/ 两个很好的学习网站 阅读全文
posted @ 2018-01-18 11:01 njuptlwh 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 本人电脑已安装Python2.7.2.5,最近在学习Python操作Excel,网上总共看到三种方法:① 使用xlrd xlwt (只适用于office 2003);② 使用openpyxl;③ win32com (类似于直接使用VB操作,有时间再仔细了解) 好,回到正题 安装openpyxl 1. 阅读全文
posted @ 2018-01-16 15:33 njuptlwh 阅读(3006) 评论(0) 推荐(0) 编辑
摘要: 带界面的Python程序,当底层函数运行时间过长,这时界面就会产生卡死的现象,体验极差。 上面这段代码在执行过程中,界面会卡死60s,只有等 test_run()执行完成后才能恢复正常。 所以应该给底层函数test_run()重新开辟一个线程,这样就能解决界面卡死的现象了 但这里又出现一个问题,子线 阅读全文
posted @ 2017-12-06 16:50 njuptlwh 阅读(2955) 评论(0) 推荐(0) 编辑