PyQt正则表达式编辑器
项目描述
关于
QRegexEditor 是一个用 Python 和 PyQt 编写的 简单 正则表达式编辑器。
您可以将 QRegexEditor 作为独立应用程序使用,也可以将其作为您自己的 PyQt/PySide 应用程序中的小部件。
本工具受到了以下项目的启发
rubular: http://rubular.com/
pythex: https://pythex.org/
安装
首先从 PyPI 安装包
pip install qregexeditor --upgrade
然后您可以运行应用程序
QRegexEditor
依赖关系
python (2.7 或 >= 3.2)
PyQt5 或 PySide 或 PyQt4
在自定义 PyQt 应用程序中使用小部件
可以将小部件用作任何其他 Qt 小部件。
您可以通过编程方式指定正则表达式和字符串模式。您还可能希望连接到 quick_ref_requested 信号,以便您的应用程序可以在最合适的位置显示/隐藏快速参考小部件。
"""
This example show you how to use the widget in a custom application.
"""
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
# if you use PyQt4 or PySide, you must set the QT_API environment variable
# to select the proper bindings, see
# https://github.com/pyQode/pyQode/wiki/Getting-started#qt-bindings-selection
from qregexeditor.api import RegexEditorWidget, QuickRefWidget
app = QApplication(sys.argv)
window = QMainWindow()
editor = RegexEditorWidget()
quick_ref = QuickRefWidget()
quick_ref.hide()
window.setCentralWidget(editor)
# show/hide quick reference widget
editor.quick_ref_requested.connect(quick_ref.setVisible)
window.show()
app.exec_()
项目详情
下载文件
下载适用于您平台的文件。如果您不确定该选择哪个,请了解更多关于安装包的信息。
源分布
QRegexEditor-0.5.3.zip (84.8 kB 查看哈希值)
构建分布
QRegexEditor-0.5.3-py2.py3-none-any.whl (52.5 kB 查看哈希值)