Searching We.Love.Privacy.Club

Twts matching #python
Sort by: Newest, Oldest, Most Relevant
In-reply-to » @movq That's cool! I also like the name of your library. :-) I assume you made the thing load quickly, didn't you?

@movq@www.uninformativ.de Yeah, I see. Just crudely checked on my computer, with around 0.013 seconds, Python 2.7 seems a tad faster than Python 3.14’s 0.023 seconds in this little program.

The lazy imports sound not too bad, but I just skimmed over them. There are surprisingly many exceptions, but yeah, no way around them. :-)

⤋ Read More
In-reply-to » @movq That's cool! I also like the name of your library. :-) I assume you made the thing load quickly, didn't you?

The baseline here is about 55 ms for nothing, btw. Python ain’t fast to start up.

$ time python -c 'exit(0)'

real    0m0.055s
user    0m0.046s
sys     0m0.007s

⤋ Read More
In-reply-to » @movq That's cool! I also like the name of your library. :-) I assume you made the thing load quickly, didn't you?

@lyse@lyse.isobeef.org

I assume you made the thing load quickly, didn’t you?

That’s the problem with Python. If you have a couple of files to import, it will take time.

I want this to be reasonably fast on my old Intel NUC from 2016 (Celeron N3050 @ 1.60GHz) and I already notice that the program startup takes about 95 ms (or 125 ms when there are no .pyc files yet). That’s still fine, but it shows that I’ll have to be careful and keep this thing very small …

Python 3.14 will bring lazy imports, maybe that can help in some cases.

⤋ Read More

Well, you girls and guys are making cool things, and I have some progress to show as well. 😅

https://movq.de/v/c0408a80b1/movwin.mp4

Scrolling widgets appears to work now. This is (mostly) Unicode-aware: Note how emojis like “😅” are double-width “characters” and the widget system knows this. It doesn’t try to place a “😅” in a location where there’s only one cell available.

Same goes for that weird “ä” thingie, which is actually “a” followed by U+0308 (a combining diacritic). Python itself thinks of this as two “characters”, but they only occupy one cell on the screen. (Assuming your terminal supports this …)

This library does the heavy Unicode lifting: https://github.com/jquast/wcwidth (Take a look at its implementation to learn how horrible Unicode and human languages are.)

The program itself looks like this, it’s a proper widget hierarchy:

https://movq.de/v/1d155106e2/s.png

(There is no input handling yet, hence some things are hardwired for the moment.)

⤋ Read More
In-reply-to » Trying to come up with a name for a new project and every name is already taken. 🤣 The internet is full!

@lyse@lyse.isobeef.org I’m toying with the idea of making a widget/window system on top of Python’s ncurses. I’ve never really been happy with the existing ones (like urwid, textual, pytermgui, …). I mean, they’re not horrible, it’s mostly the performance that’s bugging me – I don’t want to wait an entire second for a terminal program to start up.

Not sure if I’ll actually see it through, though. Unicode makes this kind of thing extremely hard. 🫤

⤋ Read More

What Might Adding Emojis and Pictures To Text Programming Languages Look Like?
theodp writes: We all mix pictures, emojis, and text freely in our communications. So why not in our code? That’s the premise of “Fun With Python and Emoji: What Might Adding Pictures to Text Programming Languages Look Like?” (two-image Bluesky explainer; full slides), which takes a look at what mixing emoji with … ⌘ Read more

⤋ Read More

Gemini AI Yielding Sloppy Code For Ubuntu Development With New Helper Script
A few weeks ago it was mentioned by a Canonical engineer how trying to use AI to modernize the Ubuntu Error Tracker yielded some code that was “plain wrong” and other issues raised by that Microsoft GitHub Copilot code. The same Ubuntu developer shifted to trying Gemini AI to generate a helper script to assist in Ubuntu’s monthly ISO snapshot releases. Google’s Gemini AI also generated some sloppy code for a Python script to assist in tho … ⌘ Read more

⤋ Read More

@kiwu@twtxt.net Assembly is usually the most low-level programming language that you can get. Typical programming languages like Python or Go are a thick layer of abstraction over what the CPU actually does, but with Assembler you get to see it all and you get full control. (With lots of caveats and footnotes. 😅)

I’m interested in the boot process, i.e. what exactly happens when you turn on your computer. In that area, using Assembler is a must, because you really need that fine-grained control here.

⤋ Read More

MI6 Chief: We’ll Be as Fluent in Python As We Are in Russian
The new chief of Britain’s Secret Intelligence Service told officers this week that they must become as fluent in programming languages like Python as they are in foreign languages like Russian as the spy agency adapts to what she described as a space between peace and war. Blaise Metreweli, MI6’s first female chief and previously the service’s direc … ⌘ Read more

⤋ Read More
In-reply-to » Come back from my trip, run my AoC 2025 Day 1 solution in my own language (mu) and find it didn't run correctly 🤣 Ooops!

Ahh that’s because I forgot to call main() at the end of the source file. mu is a bit of a dynamic programming language, mix of Go(ish) and Python(ish).

$ ./bin/mu examples/aoc2025/day1.mu 
Execution failed: undefined variable readline

⤋ Read More
In-reply-to » Advent of Code 2025 starts tomorrow. 🥳🎄

Alright, Advent of Code is over:

https://www.uninformativ.de/blog/postings/2025-12-12/0/POSTING-en.html

It’s been quite the time sink, especially with the DOS games on top, but it was fun. 🥳

In case you’re wondering: All puzzles (except for part 2 of day 10) were doable in Python 1 on SuSE Linux 6.4 and ran in a finite time on the Pentium 133. Puzzle 10/2 might have been doable as well if I had better education. 🤣

⤋ Read More
In-reply-to » Advent of Code 2025 starts tomorrow. 🥳🎄

FWIW, day 03 and day 04 where solved on SuSE Linux 6.4:

https://movq.de/v/faaa3c9567/day03.jpg

https://movq.de/v/faaa3c9567/day04%2Dv3.jpg

Performance really is an issue. Anything is fast on a modern machine with modern Python. But that old stuff, oof, it takes a while … 😅

Should have used C or Java. 🤪 Well, maybe I do have to fall back on that for later puzzles. We’ll see.

⤋ Read More
In-reply-to » Advent of Code 2025 starts tomorrow. 🥳🎄

Day 2 was pretty tough on my old hardware. Part 1 originally took 16 minutes, then I got it down to 9 seconds – only to realize later that my solution abused some properties of my particular input. A correct solution will probably take about 30 seconds. 🫤

Part 2 took 29 minutes this morning. I wrote an optimized version but haven’t tested it yet. I hope it’ll be under a minute.

Python 1 feels really slow, even compared to Java 1. And these first puzzles weren’t even computationally intensive. We’ll see how far I’ll make it …

https://movq.de/v/f831d98103/day02.jpg

⤋ Read More

Thinking about doing Advent of Code in my own tiny language mu this year.

mu is:

  • Dynamically typed
  • Lexically scoped with closures
  • Has a Go-like curly-brace syntax
  • Built around lists, maps, and first-class functions

Key syntax:

  • Functions use fn and braces:
fn add(a, b) {
    return a + b
}
  • Variables use := for declaration and = for assignment:
x := 10
x = x + 1
  • Control flow includes if / else and while:
if x > 5 {
    println("big")
} else {
    println("small")
}
while x < 10 {
    x = x + 1
}
  • Lists and maps:
nums := [1, 2, 3]
nums[1] = 42
ages := {"alice": 30, "bob": 25}
ages["bob"] = ages["bob"] + 1

Supported types:

  • int
  • bool
  • string
  • list
  • map
  • fn
  • nil

mu feels like a tiny little Go-ish, Python-ish language — curious to see how far I can get with it for Advent of Code this year. 🎄

⤋ Read More

Advent of Code 2025 starts tomorrow. 🥳🎄

This year, I’m going to use Python 1 on SuSE Linux 6.4, writing the code on my trusty old Pentium 133 with its 64 MB of RAM. No idea if that old version of Python will be fast enough for later puzzles. We’ll see.

⤋ Read More

Solus Linux 4.8 Released With Python 2 Finally Removed, Abandons Solus Software Center
In addition to the releases today of updated Endeavour OS and CachyOS, Solus 4.8 is out as the latest version of another desktop Linux distribution popular with enthusiasts… ⌘ Read more

⤋ Read More

All my newly added test cases failed, that movq thankfully provided in https://git.mills.io/yarnsocial/twtxt.dev/pulls/28#issuecomment-20801 for the draft of the twt hash v2 extension. The first error was easy to see in the diff. The hashes were way too long. You’ve already guessed it, I had cut the hash from the twelfth character towards the end instead of taking the first twelve characters: hash[12:] instead of hash[:12].

After fixing this rookie mistake, the tests still all failed. Hmmm. Did I still cut the wrong twelve characters? :-? I even checked the Go reference implementation in the document itself. But it read basically the same as mine. Strange, what the heck is going on here?

Turns out that my vim replacements to transform the Python code into Go code butchered all the URLs. ;-) The order of operations matters. I first replaced the equals with colons for the subtest struct fields and then wanted to transform the RFC 3339 timestamp strings to time.Date(…) calls. So, I replaced the colons in the time with commas and spaces. Hence, my URLs then also all read https, //example.com/twtxt.txt.

But that was it. All test green. \o/

⤋ Read More

Python Developers Looking At Introducing The Rust Programming Language In CPython
A proposal has been raised by two CPython core developers to introduce the Rust programming language to CPython. Initially the focus is on allowing Rust to be used for developing optional extension modules for CPython but ultimately their goal is for Rust to become a hard dependency of CPython and used throughout its codebase… ⌘ Read more

⤋ Read More
In-reply-to » FTR, I see one (two) issues with PyQt6, sadly:

@movq@www.uninformativ.de I think I now remember having similar problems back then. I’m pretty sure I typically consulted the Qt C++ documentation and only very rarely looked at the Python one. It was easy enough to translate the C++ code to Python.

Yeah, the GIL can be problematic at times. I’m glad it wasn’t an issue for my application.

⤋ Read More
In-reply-to » There are no really good GUI toolkits for Linux, are there?

FTR, I see one (two) issues with PyQt6, sadly:

  1. The PyQt6 docs appear to be mostly auto-generated from the C++ docs. And they contain many errors or broken examples (due to the auto-conversion). I found this relatively unpleasent to work with.
  2. (Until Python finally gets rid of the Global Interpreter Lock properly, it’s not really suited for GUI programs anyway – in my opinion. You can’t offload anything to a second thread, because the whole program is still single-threaded. This would have made my fractal rendering program impossible, for example.)

⤋ Read More

Could C# Overtake Java in TIOBE’s Programming Language Popularity Rankings?
It’s been trying to measure the popularity of programming languages since 2000 using metrics like the number of engineers, courses, and third-party vendors. And “The November 2025 TIOBE Index brings another twist below Python’s familiar lead,” writes TechRepublic. “C solidifies its position as runner-up, C++ and Java lose … ⌘ Read more

⤋ Read More

Python Foundation Donations Surge After Rejecting Grant - But Sponsorships Still Needed
After the Python Software Foundation rejected a $1.5 million grant because it restricted DEI activity, “a flood of new donations followed,” according to a new report. By Friday they’d raised over $157,000, including 295 new Supporting Members paying an annual $99 membership fee, says PSF executi … ⌘ Read more

⤋ Read More

Manufacturer Bricks Smart Vacuum After Engineer Blocks It From Collecting Data
A curious engineer discovered that his iLife A11 smart vacuum was remotely “killed” after he blocked it from sending data to the manufacturer’s servers. By reverse-engineering it with custom hardware and Python scripts, he managed to revive the device to run fully offline. Tom’s Hardware reports: An engineer got cu … ⌘ Read more

⤋ Read More
In-reply-to » There are no really good GUI toolkits for Linux, are there?

@movq@www.uninformativ.de Yeah, give it a shot. At worst you know that you have to continue your quest. :-)

Fun fact, during a semester break I was actually a little bored, so I just started reading the Qt documentation. I didn’t plan on using Qt for anything, though. I only looked at the docs because they were on my bucket list for some reason. Qt was probably recommended to me and coming from KDE myself, that was motivation enough to look at the docs just for fun.

The more I read, the more hooked I got. The documentation was extremely well written, something I’ve never seen before. The structure was very well thought out and I got the impression that I understood what the people thought when they actually designed Qt.

A few days in I decided to actually give it a real try. Having never done anything in C++ before, I quickly realized that this endeavor won’t succeed. I simply couldn’t get it going. But I found the Qt bindings for Python, so that was a new boost. And quickly after, I discovered that there were even KDE bindings for Python in my package manager, so I immediately switched to them as that integrated into my KDE desktop even nicer.

I used the Python KDE bindings for one larger project, a planning software for a summer camp that we used several years. It’s main feature was to see who is available to do an activity. In the past, that was done on a large sheet of paper, but people got assigned two activities at the same time or weren’t assigned at all. So, by showing people in yellow (free), green (one activity assigned) and red (overbooked), this sped up and improved the planning process.

Another core feature was to generate personalized time tables (just like back in school) and a dedicated view for the morning meeting on site.

It was extended over the years with all sorts of stuff. E.g. I then implemented a warning if all the custodians of an activitiy with kids were underage to satisfy new the guidelines that there should be somebody of age.

Just before the pandemic I started to even add support for personalized live views on phones or tablets during the planning process (with web sockets, though). This way, people could see their own schedule or independently check at which day an activity takes place etc. For these side quests, they don’t have to check the large matrix on the projector. But the project died there.

Here’s a screenshot from one of the main views: https://lyse.isobeef.org/tmp/k3man.png

This Python+Qt rewrite replaced and improved the Java+Swing predecessor.

⤋ Read More
In-reply-to » There are no really good GUI toolkits for Linux, are there?

@movq@www.uninformativ.de Don’t you worry, this was meant as a joke. :-D

There was a time when I thought that Swing was actually really good. But having done some Qt/KDE later, I realized how much better that was. That were the late KDE 3 and early KDE 4 days, though. Not sure how it is today. But back then it felt Trolltech and the KDE folks put a hell lot more thought into their stuff. I was pleasantly surprised how natural it appeared and all the bits played together. Sure, there were the odd ends, but the overall design was a lot better in my opinion.

To be fair, I never used it from C++, always the Python bindings, which were considerably more comfortable (just alone the possibility to specify most attributes right away as kwargs in the constructor instead of calling tons of setters). And QtJambi, the Java binding, was also relatively nice. I never did a real project though, just played around with the latter.

⤋ Read More

Python Software Foundation has bigger spine than big tech
Back in January 2025, the Python Software Foundation applied for a $1.5 million grant from the US government’s National Science Foundation, under the Safety, Security, and Privacy of Open Source Ecosystems program, to address structural vulnerabilities in Python and PyPI. After a lot of paperwork, their application was approved, but upon receiving the contractual agreement, the Python Software Foundation decided to b … ⌘ Read more

⤋ Read More

Mathieu Pasquet: slixmpp v1.12
This version is out mostly to provide a stable version with compatibility with the newly released Python 3.14, there are nonetheless a few new things on top.

Thanks to all contributors for this release!

Fixes
  • Bug in MUC self-ping ( XEP-0410) that would create a traceback in some uses
  • Bug in SIMS ( XEP-0447) where all media would be marked as inline
  • Python 3.14 breakage
Features

⤋ Read More