📜 ⬆️ ⬇️

PyRegs: Python 3 Regular Expression Analyzer

When Kodos is gone


The trouble came unexpectedly. The good old PyQt3 was removed from Debian Wheezy. And Kodos , my favorite Python regular expression debugger, went to rest with him. For many years, he helped test beautiful and creepy constructions and the fact that apt-get install kodos no longer works caused me to immediately correct this unfortunate misunderstanding.

Pyregs


Under the hood

PyRegs was written from scratch and the components were selected with the goal “to work for a long time and without any extra dancing with a tambourine.” Python 2.7 does not fit the definition for a long time , for the simple reason that at some point it will be removed from the GNU / Linux distributions and standard packages of other OS, replacing it completely with Python 3.x. PyQT, PySide, PyWx, PyGObject, etc. - great solutions, but dancing with a tambourine is more likely not to be avoided: in one OS there is something and it works, in the other one it doesn’t or does not work. But why use third-party solutions when
Tkinter is a Python's de-facto standard GUI (Graphical User Interface) package.

Tkinter has quite a few pitfalls, starting with the fact that the Python code is translated into tcl commands and ending with the absence of some standard widgets like tooltip. Why not challenge the programmer ?! :) Thus, the choice of technologies became obvious: Python 3 + tkinter.

What happened

Kodos users will find the interface very familiar:


')
A regular expression is entered in the upper text field, on average, the text and below, the analysis results.



From invisible to the eye features - text processing occurs in a separate thread, so that the GUI does not hang and shows the number of processed text in percent (in practice, this happens only with very complex expressions and very long text).

Comrades!

I ask your attention, advice, comments and ideas. Try PyRegs is very simple:
$ apt-get install python3-tk $ $ virtualenv env -p python3 $ . env/bin/activate $ pip install pyregs $ pyregs 

Or: github.com/BasicWolf/pyregs

Thank you for attention!

Source: https://habr.com/ru/post/183486/


All Articles