pyqt5
xsophiax
这个作者很懒,什么都没留下…
展开
-
Python学习笔记之re使用问题bad escape \\U
在re进行字符串处理是,有时会出现如下问题bad escape \U 获取其它问题类似问题,如下所示;经过跟如re类发现,是由于\\U的转义造成的;1. 示例import redef demo_re(): xlsPath = r'C:\Users\Administrator' lines = r''' set patchRomPath="J:/Bluetooth/" set xlsPath="C:\Users\Administrator\Desktop"原创 2021-01-08 15:44:59 · 2193 阅读 · 0 评论 -
Python学习笔记之wkhtmltopdf使用
在使用wkhtmltopdf时出现如下问题: from main import WKhtmlToPdf, wkhtmltopdfModuleNotFoundError: No module named 'main'而直接看网上,存在好多类似的问题,我看了源码,发现其不仅存在一些问题,还仅支持到Python2.x;如果要支持Python 3.x还需要修改一些东西;1. init文件修改api临时永不到,先注释掉了。from .main import WKhtmlToPdf...原创 2020-12-31 15:37:57 · 2421 阅读 · 0 评论 -
Python学习笔记之函数print颜色显示
1. print颜色def demo_print(): print('\033[30m打印前景色0\033[0m') print('\033[31m打印前景色1\033[0m') print('\033[32m打印前景色2\033[0m') print('\033[33m打印前景色3\033[0m') print('\033[34m打印前景色4\033[0m') print('\033[35m打印前景色5\033[0m') print('\033原创 2020-10-27 18:15:27 · 676 阅读 · 0 评论 -
在PyCharm 配置使用flake8进行语法检测
1.安装Flake8必须在console中进行安装,示:pip install flake82.配置PycharmProgram: $PyInterpreterDirectory$/pythonarguments:-m flake8 --max-line-length=130 --exclude venv,migrations $ProjectFileDir$wor...原创 2019-10-14 15:11:06 · 3828 阅读 · 0 评论 -
使用J-Link SEGGER RTT来打印输出调试信息
1.使用JLINK SEGGER RTT打印调试信息很简单,首先从Jlink官网上下载RTT代码,然后将这四个文件添加到自己工程中去,并且在主程序工程中添加SEGGER_RTT.h文件2. 下载集成文件(4个)很简单,首先从Jlink官网上下载RTT代码,然后将这四个文件添加到自己工程中去,并且在主程序工程中添加SEGGER_RTT.h文件之后可以使用SEGGER_RTT_pr...原创 2019-09-18 16:00:18 · 3213 阅读 · 3 评论 -
Python学习笔记之PyQt5布局 - BoxLayout & GridLayout
1.BOX布局import sysfrom PyQt5.QtWidgets import (QWidget, QPushButton, QHBoxLayout, QVBoxLayout, QApplication)class BoxLayout(QWidget): def __init__(self): super().__init__() ...原创 2019-08-13 15:38:11 · 2452 阅读 · 0 评论 -
Python学习笔记之PyQt5菜单Check - CheckMenuBar
在项目中会使用到要让某个menu处于check状态:import sysfrom PyQt5.QtWidgets import QMainWindow, QAction, QApplicationclass checkMenuBar(QMainWindow): def __init__(self): super().__init__() s...原创 2019-08-13 15:24:37 · 1629 阅读 · 0 评论 -
Python学习笔记之PyQt5光标位置追踪 - mouseMoveEvent
在绘图过程中或者在自定义控件过程中,有时会要获取光标位置:import sysfrom PyQt5.QtCore import Qtfrom PyQt5.QtWidgets import QWidget, QApplication, QGridLayout, QLabelclass mouseMoveEvent(QWidget): def __init__(self):...原创 2019-08-13 15:11:46 · 5422 阅读 · 0 评论 -
Python学习笔记之PyQt5窗口居中对齐 - helloWorld
在工作中有时候要某些窗口居中,就要使用到如下code逻辑。import sysfrom PyQt5.QtWidgets import QWidget, QDesktopWidget, QApplicationclass helloWorld(QWidget): def __init__(self): super().__init__() s...原创 2019-08-13 14:57:25 · 1086 阅读 · 0 评论 -
Python学习笔记之PyQt5窗口程序入门(一个工作中能用的示例)
1. 首先使用QT(具体怎么安装自行查哦)的Designer手动编辑一个类似如下的的UI界面;然后把UI_DEMO保存到一个指定的文件夹中;2. 在PyCharm中使用PyUIC工具来把UI_DEMO转成UI_DEMO.py文件;2.1 如何配置PyUIC请参考如下所示(File-Settings-Tool-Extenaltools):3. 编写UI_Main 主窗口文件...原创 2019-03-09 16:16:43 · 1609 阅读 · 0 评论