analitics

Pages

Saturday, January 10, 2026

Python313 : testing the potracer python package.

Pure Python Port of Potrace. This is a python port of Peter Selinger's Potrace (based on 1.16 code).
Today, I install the python package with pip tool:
pip install potracer[cli]
Collecting potracer[cli]
...
Successfully installed potrace-cli-0.0.4 potracer-0.0.4
The dir command show me all of these :
dir(potrace)
['BezierSegment', 'Bitmap', 'COS179', 'CornerSegment', 'Curve', 'INFTY', 'Optional', 'POTRACE_CORNER', 
'POTRACE_CURVETO', 'POTRACE_TURNPOLICY_BLACK', 'POTRACE_TURNPOLICY_LEFT', 'POTRACE_TURNPOLICY_MAJORITY',
'POTRACE_TURNPOLICY_MINORITY', 'POTRACE_TURNPOLICY_RANDOM', 'POTRACE_TURNPOLICY_RIGHT', 'POTRACE_TURNPOLICY_WHITE',
'Path', 'Tuple', 'Union', '_Curve', '_Path', '_Point', '_Segment', '_Sums', '__builtins__', '__cached__', '__doc__',
'__file__', '__loader__', '__name__', '__package__', '__spec__', '_adjust_vertices', '_bestpolygon', '_calc_lon',
'_calc_sums', '_opticurve', '_smooth', 'bezier', 'bm_to_pathlist', 'cprod', 'cyclic', 'ddenom', 'ddist', 'detrand',
'detrand_t', 'dorth_infty', 'dpara', 'findnext', 'findpath', 'floordiv', 'interval', 'iprod', 'iprod1', 'majority',
'math', 'mod', 'np', 'opti_penalty', 'opti_t', 'pathlist_to_tree', 'penalty3', 'pointslope', 'process_path', 'quadform',
'reverse', 'setbbox_path', 'sign', 'sq', 'tangent', 'xor_path', 'xor_to_ref', 'xprod']
See GitHub project from the tatarize.
I used the default example from the github project and works very well.

Python Qt6 : use default PyQt styles to PyQt6 applications.

Today, about PyQt Styles to PyQt6 Applications.
This works with default themes and how to change these, and using different types of custom styling.
First , let's see the source code with default themes:
from PyQt6.QtWidgets import QStyleFactory
print(QStyleFactory.keys())
['windows11', 'windowsvista', 'Windows', 'Fusion']
Let's see the source code for this simple script with this theme windows11:
import sys
from PyQt6.QtWidgets import (
    QApplication, QLabel, QLineEdit, QComboBox, QPushButton,
    QCheckBox, QSlider, QVBoxLayout, QWidget
)
from PyQt6.QtCore import Qt

app = QApplication(sys.argv)
app.setStyle('windows11')

window = QWidget()
layout = QVBoxLayout(window)

# 1. QLabel
layout.addWidget(QLabel("Acesta este un QLabel"))

# 2. QLineEdit
layout.addWidget(QLineEdit("Text editabil"))

# 3. QComboBox
combo = QComboBox()
combo.addItems(["Optiunea 1", "Optiunea 2", "Optiunea 3"])
layout.addWidget(combo)

# 4. QCheckBox
layout.addWidget(QCheckBox("Bifează această opțiune"))

# 5. QSlider
slider = QSlider(Qt.Orientation.Horizontal)
layout.addWidget(slider)

# 5. QPushButton
button = QPushButton('Simple button !')
layout.addWidget(button)

# show the main windows 
window.show()
sys.exit(app.exec())

News : PyQt v6.10.2 Released .

PyQt v6.10.2 has been released. This is a bug-fix release.
  • Fixed a regression introduced in v6.5.0 in the handling of the return value of QSqlQueryModel.query().
  • Fixed a regression introduced in v6.10.1 in the handling of the return value of createMimeDataFromSelection() in QTextEdit and QPlainTextEdit.