analitics

Pages

Saturday, February 28, 2026

Python 3.13.0 : simple script for update all python packages.

Simple script for update all python packages:
import subprocess
import sys
import datetime

log_file = "upgrade_log.txt"

def log(msg):
    with open(log_file, "a", encoding="utf-8") as f:
        f.write(msg + "\n")
    print(msg)

def get_installed_packages():
    result = subprocess.run(
        [sys.executable, "-m", "pip", "list", "--format=freeze"],
        capture_output=True,
        text=True
    )
    lines = result.stdout.strip().split("\n")
    packages = []
    for line in lines:
        if "@" in line:  # skip direct URL installs
            pkg = line.split("@")[0]
        else:
            pkg = line.split("==")[0]
        packages.append(pkg)
    return sorted(packages)

def upgrade_package(package):
    log(f"\n=== Updating: {package} ===")
    try:
        subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", package])
        log(f"[OK] Updated: {package}")
    except subprocess.CalledProcessError:
        log(f"[FAILED] Could not update: {package}")

def main():
    log(f"\n--- Upgrade started at {datetime.datetime.now()} ---\n")

    packages = get_installed_packages()
    log(f"Found {len(packages)} packages.\n")

    for pkg in packages:
        upgrade_package(pkg)

    log(f"\n--- Upgrade finished at {datetime.datetime.now()} ---\n")

if __name__ == "__main__":
    main()

Wednesday, February 25, 2026

Python 3.13.0 : build123d the BREP for 2D and 3D CAD.

build123d is a Python-based, parametric boundary representation (BREP) modeling framework for 2D and 3D CAD. Built on the Open Cascade geometric kernel, it provides a clean, fully Pythonic interface for creating precise models suitable for 3D printing, CNC machining, laser cutting, and other manufacturing processes.
You can find more about this project on the GitHub repo.
python -m pip install build123d
Collecting build123d
  Downloading build123d-0.10.0-py3-none-any.whl.metadata (6.7 kB)
...
Successfully installed anytree-2.13.0 asttokens-3.0.1 build123d-0.10.0 cadquery-ocp-7.8.1.1.post1 cadquery_ocp_proxy-7.9.3.1 cadquery_vtk-9.3.1 decorator-5.2.1 executing-2.2.1 ezdxf-1.4.3 ipython-9.10.0 ipython-pygments-lexers-1.1.1 lib3mf-2.5.0 matplotlib-inline-0.2.1 ocp_gordon-0.2.0 ocpsvg-0.5.0 pure-eval-0.2.3 stack_data-0.6.3 svgelements-1.9.6 svgpathtools-1.7.2 traitlets-5.14.3 trianglesolver-1.2 webcolors-24.8.0

Sunday, February 15, 2026

News : PySimpleGUI planned shutdown

The PySimpleGUI project’s planned shutdown was first announced in February 2025. At that time, we committed to supporting our Commercial customers through the end of 2025. PySimpleGUI 5 remained a very stable product throughout the year, with no significant issues reported.
Now that we’ve reached the end of that support period, the project is entering its final stage. During January 2026, the PySimpleGUI website, documentation, and PyPI servers will be taken offline as we officially close the project.
The private PyPI server will be shut down in January 2026 . If you currently install PySimpleGUI 5 using pip, you’ll need to switch to installing from a local wheel file instead.

Tools : Pickcode online I.D.E.

Pickcode is an online IDE, similar to Trinket. With a free account, you can create unlimited projects in Python, Java, and HTML/CSS/JS.
With our paid Pickcode Classroom plan, teachers can create lessons, set up classes and assignments, and view student work in real time.
Pickcode Classroom costs $500/teacher plus $10/student per year. We are considering options for adding a lower-priced plan similar to Trinket’s Code+, and will have more info about that later this year.

News : Trinket will be shutting down in early August 2026.

We are deeply grateful for your support over the years. Trinket has been used by millions of learners and educators, and it has been an honor to be part of your coding journey.
We're truly sorry for any disruption this may cause. If you have questions, please reach out to us at help@trinket.io.
If you have an annual subscription, you'll continue to have full access until the end of your current paid period. Your subscription will not renew.
Monthly subscriptions will not renew after June 30, 2026.
Trinket will be shutting down in early August 2026.
After this date, trinket.io will no longer be available, and you will not be able to access your trinkets, courses, or any content on this site. Please download anything you want to keep before the shutdown.

Saturday, February 14, 2026

Python Qt6 : using the py3Dmol .

NOTE : hacker provider ... :
Simple example with the py3Dmol:
import os
import sys

from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout
from PyQt6.QtWebEngineWidgets import QWebEngineView
from PyQt6.QtCore import QUrl
import py3Dmol

SEROTONIN_SMILES = "C1=CC2=C(C=C1)C(=CN2)CCN"

def generate_html(smiles):
    view = py3Dmol.view(width=800, height=600)
    view.addModel(smiles, "smiles")
    view.setStyle({"stick": {}})
    view.zoomTo()
    return view._make_html()

class MoleculeViewer(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("Structura 3D – Serotonină")

        layout = QVBoxLayout(self)
        self.browser = QWebEngineView()

        html = generate_html(SEROTONIN_SMILES)

        # IMPORTANT: QUrl, nu string!
        self.browser.setHtml(html, baseUrl=QUrl("https://localhost/"))

        layout.addWidget(self.browser)

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = MoleculeViewer()
    window.resize(900, 700)
    window.show()
    sys.exit(app.exec())

Wednesday, February 11, 2026

Python Qt6 : remove files by size.

After the vendor hacker changed my file sizes to 0kb and 1kb, only from the folders on my laptop and backup on the backup hdd, for the development project with the game I was working on with artificial intelligence. I created a script in Python to see if he left anything in the folders and subfolders.

Tuesday, February 10, 2026

Python Qt6 : one simple markdown editor.

Today, I tested my simple Markdown editor. I used artificial intelligence.
This project is a custom Markdown editor built with PyQt6.
It provides a two‑panel interface where the user writes Markdown on the right side and sees a live HTML preview on the left side.
The goal is to offer a simple and efficient workflow similar to GitHub’s Markdown rendering.
Main Features
  • Two‑panel layout The left panel displays the rendered HTML preview, while the right panel contains the Markdown editor and formatting buttons.
  • Real‑time preview Every change in the editor updates the preview instantly. The preview uses multiple Markdown extensions to support tables, lists, code blocks, footnotes, and other GitHub‑style formatting.
  • Image support Images inserted through the editor are converted to local file URLs. This ensures that the preview panel can load them correctly, even when the image is stored outside the project folder.
  • Markdown extensions The editor enables a wide set of extensions, including:
    • tables
    • fenced code blocks
    • footnotes
    • definition lists
    • smart quotes
    • wiki links
    • admonitions
    • GitHub‑style lists
    These extensions allow the preview to closely match GitHub’s Markdown rendering.
  • Editing toolbar The editor includes quick‑insert buttons for bold, italic, lists, and images. These buttons modify only the Markdown text in the editor panel.
  • Zoom controls The preview panel includes buttons for resetting zoom to 100 percent, zooming in, and zooming out. This helps when working with long documents or detailed tables.
  • File operations The application supports creating, opening, and saving Markdown files. It also includes an option to export the rendered content as an HTML file.
  • Theme switching Users can switch between light and dark themes depending on their preference.
  • Drag and drop Markdown files can be opened by dragging them directly into the window.
  • Plugin system The editor includes a simple plugin mechanism that allows adding new features without modifying the core application.
  • Status bar The bottom bar displays the current file path, file size, and word count.

Monday, February 9, 2026

Python 3.13.0 : New Feature: Interactive History Search.

If you are using the new Python 3.13 REPL, you might have noticed a new prompt when pressing certain keys. This is the upgraded interactive shell that now supports built-in history searching.
What is f-search and r-search?
These features allow you to search through every command you have previously typed without using the arrow keys.
How to trigger it:
- Press Ctrl + R to initiate a Reverse Search. You will see (r-search ''). This looks through your history from newest to oldest.
- Press Ctrl + S to initiate a Forward Search. You will see (f-search ''). This looks through your history from oldest to newest.
How to use it:
1. Type the shortcut (Ctrl+R or Ctrl+S).
2. Start typing any part of a previous command (e.g., 'import' or 'def').
3. The shell will automatically complete the line with the best match.
4. Press Enter to run the command, or use the arrow keys to start editing the found line.
5. If you want to cancel the search, simply press Ctrl + G.
This feature makes the Python 3.13 terminal feel much more like a modern shell, saving time and reducing repetitive typing.
C:\Python313_64bit>python
Python 3.13.0 (tags/v3.13.0:60403a5, Oct  7 2024, 09:38:07) [MSC v.1941 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> import sys
(r-search `os') import os