I want to present the twtxt feed from Python Valencia: https://twtxt.python-valencia.es/
Technical curiosity: It is generated using n8n, using the official rss.
#welcome
tt reimplementation that I already followed with the old Python tt. Previously, I just had a few feeds for testing purposes in my new config. While transfering, I "dropped" heaps of feeds that appeared to be inactive.
Thanks, @movq@www.uninformativ.de!
My backing SQLite database with indices is 8.7 MiB in size right now.
The twtxt cache is 7.6 MiB, it uses Pythonâs pickle module. And next to it there is a 16.0 MiB second database with all the read statuses for the old tt. Wow, super inefficient, it shouldnât contain anything else, itâs a giant, pickled {"$hash": {"read": True/False}, âŠ}. What the heck, why is it so big?! O_o
I now subscribed to most feeds in my Go tt reimplementation that I already followed with the old Python tt. Previously, I just had a few feeds for testing purposes in my new config. While transfering, I âdroppedâ heaps of feeds that appeared to be inactive.
This might motivate me to actually âfinishâ the new client, so that it could become my daily driver. No need to use the old software stack any longer. Letâs see how bad this goes.
@movq@www.uninformativ.de Yeah, most of the graphical applications are actually KDE programs:
- KMail â e-mail client
- Okular â PDF viewer
- Gwenview â image viewer
- Dolphin â file browser
- KWallet â password manager (I want to check out
passone day. The most annoying thing is that when I copy a password, it says that the password has been modified and asks me whether I want to save the changes. I never do, because the password is still the same. I donât get it.)
- KPatience â card game
- Kdenlive â video editor
- Kleopatra â certificate manager
Qt:
- VLC â video player
- Psi â Jabber client (I happily used Kopete in the past, but that is not supported anymore or so. I donât remember.)
- sqlitebrowser â SQLite browser
Gtk:
- Firefox â web browser
- Quod Libet â music player (I should look for a better alternative. Canât remember why I had to move away from Amarok, was it dead? There was a fork Clementine or so, but I had to drop that for some unknown reason, too.)
- Audacity â audio editor
- GIMP â image editor
These are the things that are open right now or that I could think of. Most other stuff I actually do in the terminal.
In the pastâą, I used the Python KDE4 bindings. That was really nice. I could pass most stuff directly in the constructor and didnât have to call gazillions of setters improving the experience significantly. If I ever wanted to do GUI programming again, Iâd definitely go that route. There are also great Qt bindings for Python if one wanted to avoid the KDE stuff on top. The vast majority I do for myself, though, is either CLI or maybe TUI. A few web shit things, but no GUIs anymore. :-)
I have finished 1-9 on Python. If anyone is interested, I could share the code, or in Reddit many people have shared theirs.
In a couple of days Iâll be giving a talk about #twtxt https://www.meetup.com/es-ES/python-valencia-meetup/events/306769708/
@andros@twtxt.andros.dev If something fits in a CSV file, it typically doesnât require a database. I agree with that. Depending on the application, more complicated queries might benefit from a database, though. I donât know awk very well, but I could imagine that grep, sed and cut reach their CSV processing limits rather quickly when you have to deal with escaped (multiline) fields.
I only very rarely have to deal with CSV files or databases in my day to day life. Maybe, these classic Unix tools offer some tricks Iâm not aware of. When I have some more complicated CSV input, I generally reach for Python.
looks good now!
description = đ Full-Stack developer (Mainly Python) â Writer[...]
Iâm developing a tutorial for the Django Girls. Does anyone here have experience with #Django ? #python
The project is a POC (Proof of Concept) that went into production and the company has customers who are using it. The developers had been working for several years, without testing, structure, isolation and so on. The company hired me to transform the project into a real product. There are in my hands 422 python files to transform that they beg me a refactore, architecture and testing. Every developerâs bad dream.
My first step is to read and understand the tree because there are apps inside other apps call each other. I am very determined to work on a new repository.
? operator in Go đ No. For so many reasons.
@prologic@twtxt.net Which one? I donât mind the ternary operator at all. In fact, I often find myself missing it in Go. I donât find the two alternatives particularly elegant:
foo := "eggs"
if bar {
foo = "spam"
}
Or:
var foo string
if bar {
foo = "spam"
} else {
foo = "eggs"
}
To my eye, this just would look a lot nicer:
foo := bar ? "spam" : "eggs"
Or at least as the Pythons do it:
foo = "spam" if bar else "eggs"
The ternary operator especially shines with relatively short expressions.
For many years I have found Flask to be too basic a tool for modern development. But since I create APIs using Flask with Pydantic to validate the input data, some middlewares for parsing and Blueprint to separate the code into modules⊠I must admit that I am super comfortable, fast and easy to test.
#flask #python #pydantic
What is clean architecture? Thatâs a good question.
You think of a pattern for ordering code with good decisions isolating technologies (you can change the web framework or database without break the business logic), easy to test (you only test interfaces and use cases), sharing code between frameworks (entities and use cases), scalability, modulations and standardizing names. Clean architecture is not perfect, it has a learning curve and some abstraction in each technology. You can even find rejection with yours colleagues.
I have a good article on this topic.
https://programadorwebvalencia.com/implementando-arquitectura-limpia-en-python/
#python
Yes, itâs a mini python cgi script which implements IndieAuth
Yeah, @bender@twtxt.net, I absolutely love it! :-D Monty Python just rocks!
This very knight inspired me to make myself a knight helmet with opening visor out of an old washing machine sheet metal years ago for a theater play. It was really great fun, both making the helmet as well as using it during the week in the play as a silly and shady prince who got all his tracts of land by winning dubious games.
I just couldnât really hear very well in it. And if somebody hit me on the head or just slightly knocked on the helmet, it was incredibly loud. No fine craftmanship by any means and obviously historically extremely questionable at best, but it did the job well enough. One of the running gags was that I had to open the visor when I wanted to talk. Here are some photos in action, youâll find many more when surfing through the gallery:
- https://wawuwo.de/2016/woche2/montag/017.html#image
- https://wawuwo.de/2016/woche2/dienstag/019.html#image
- https://wawuwo.de/2016/woche2/mittwoch/156.html#image
- https://wawuwo.de/2016/woche2/donnerstag/008.html#image
- https://wawuwo.de/2016/woche2/freitag/036.html#image In one lunch break my page and I decided to dress up and play a game of dice against the kids. However, we used badly cogged dice. We just added a few dots of paint on one of the two dice, so that it had two fours, two fives and two sixes or something like that. I always told my opponents: âYou can choose whatever dice you want. Except for the red one, thatâs my lucky dice!â As well-behaved children, they then selected the blue, unbiased one. And usually lost. However, I remember there was one kid that beat me with four sixes in row. :-D Although we thought, we make it halfway obvious that this game is truly not fair, it took them extremely long to figure out that we had messed with my lucky dice. When they finally did, they got super angry. Some of them were on the brink of beating me up. That was really nice to see their sense of justice kick it. :-)
- https://wawuwo.de/2016/woche2/freitag/169.html#image
@prologic@twtxt.net mediacms! itâs janky yeah but it does the job ultimately (even if sometimes videos donât encode and i gotta do some weird python venv shit to force the encode lolâŠ)
base(2) or base(16) in calc to do that. Thatâs exhausting after a while.
@movq@www.uninformativ.de Thanks! I already found it and patched it to run in my ancient Python version (no match keyword and exec(âŠ) only allows globals and locals as positional arguments). :-) https://lyse.isobeef.org/tmp/mcalc-patched.py.txt
@movq@www.uninformativ.de Yeah, the Python docs are more like a book. They absolutely shine if you have no idea and read them from top to bottom. The tutorial is baked right in. But they donât work all that perfect as cheat sheets. I also remember looking for the return types way too long in the past.
I would have thought that this could be easily improved when type hints are in place. And it sure does: https://www.tornadoweb.org/en/stable/httpclient.html#tornado.httpclient.HTTPClient.fetch
For some reason, I was using calc all this time. I mean, itâs good, but I need to do base conversions (dec, hex, bin) very often and you have to type base(2) or base(16) in calc to do that. Thatâs exhausting after a while.
So I now replaced calc with a little Python script which always prints the results in dec/hex/bin, grouped in bytes (if the result is an integer). Thatâs what I need. Itâs basically just a loop around Pythonâs exec().
$ mcalc
> 123
123 0x[7b] 0b[01111011]
> 1234
1234 0x[04 d2] 0b[00000100 11010010]
> 0x7C00 + 0x3F + 512
32319 0x[7e 3f] 0b[01111110 00111111]
> a = 10; b = 0x2b; c = 0b1100101
10 0x[0a] 0b[00001010]
> a + b + 3 * c
356 0x[01 64] 0b[00000001 01100100]
> 2**32 - 1
4294967295 0x[ff ff ff ff] 0b[11111111 11111111 11111111 11111111]
> 4 * atan(1)
3.141592653589793
> cos(pi)
-1.0
The fact that the official Python docs donât clearly state what a function returns, grinds my gears. This has cost me so much time over the years. You always have to read through a huge block of text.

You could at least put a list of possible return values in there (always at the same location, please!), hereâs a mockup:

I want to share the video of my last talk: Creating an Instagram in Django for an Iberian lynx https://www.youtube.com/watch?v=dW69cYIULh8
python cgi script which handles micropub and writes content to twtxt file. I was want micropub+microsub for twtverse but seems i burned (due choice wrong stack?): https://privatebin.net/?0b598b91ac186855#BfRKjLUQz5KUFJNekJBb5V2qvtEe8xQN8nenYbkez2XR
testing the bluesky cross-poster i added into my silly python script for posting status updates
testing the bluesky cross-poster i added into my silly python script for posting status updates
testing the bluesky cross-poster i added into my silly python script for posting status updates
@bender@twtxt.net I see. Interesting articles, ta! Have you seen a python or iguana in the wild?
Honestly⊠not much. Have abandon two projects (both private) on Golang and one related to cryptography. My mostly languages are Python and Javascript (also can PHP). After writing code on Go i spend same time on fixing dumb errors
f:
@falsifian@www.falsifian.org You are correct, but I ended up switching to /data/data/com.termux/files/usr/tmp as suggested by @doesnm@doesnm.p.psf.lt in (#66py4ja). there must have been a reason why that file was placed in /tmp/ in the first place, I just donât know my way around python that much to figure it out đ
.
Now WTF!? Suddenly, @falsifian@www.falsifian.orgâs feed renders broken in my tt Python implementation. Exactly what I had with my Go rewrite. I havenât touched the Python stuff in ages, though. Also, tt and tt2 do not share any data at all.
By any chance, did you remove the ; charset=utf-8 from your Content-Type: text/plain header, falsifian?

@mckinley@twtxt.net To answer some of your questions:
Are SSH signatures standardized and are there robust software libraries that can handle them? Weâll need a library in at least Python and Go to provide verified feed support with the currently used clients.
We already have this. Ed25519 libraries exist for all major languages. Aside from using ssh-keygen -Y sign and ssh-keygen -Y verify, you can also use the salty CLI itself (https://git.mills.io/prologic/salty), and Iâm sure there are other command-line tools that could be used too.
If we all implemented this, every twt hash would suddenly change and every conversation thread weâve ever had would at least lose its opening post.
Yes. This would happen, so weâd have to make a decision around this, either a) a cut-off point or b) some way to progressively transition.
I love shell scripts because theyâre so pragmatic and often allow me to get jobs done really quickly.
But sadly theyâre full of pitfalls. Pitfalls everywhere you look.
Today, a coworker â whoâs highly skilled, not a newbie by any means â ran into this:
$ bash -c 'set -u; foo=bar; if [[ "$foo" -eq "bar" ]]; then echo it matches; fi'
bash: line 1: bar: unbound variable
Whyâs that happening? I know the answer. Do you? đ
Stuff like that made me stop using shell scripts at work, unless theyâre just 4 or 5 lines of absolutely trivial code. Itâs now Python instead, even though the code is often much longer and clunkier, but at least people will understand it more easily and not trip over it when they make a tiny change.
If youâre using jenny on Python 3.12, it will spit out a deprecation warning regarding datetime.utcnow(). This will be fixed in the next release.
Things can get very interesting when we add the iter.Pull function in the mix. It works like pythons yield from.

This day one advantage of code was pretty neat looking.
https://twitter.com/gereleth/status/1730495736070938786?s=09
Code here: https://github.com/gereleth/aoc_python/blob/main/src/year2023/day01vis.py
Show HN: A Python Job Board for Python Developers
Article URL: https://www.pycareer.io
Comments URL: https://news.ycombinator.com/item?id=36860953
Points: 574
# Comments: 1 â Read more
@prologic@twtxt.net It was super useful if you needed to do the sorts of things it did. Iâm pretty sad.
At its core was Sage, a computational mathematics system, and their own version of Jupyter notebooks. So, you could do all kinds of different math stuff in a notebook environment and share that with people. But on top of that, there was a chat system, a collaborative editing system, a course management system (so if you were teaching a class using it you could keep track of students, assignments, grades, that sort of thing), and a bunch of other stuff I never used. It all ran in a linux container with python/conda as a base, so you could also drop to a terminal, install stuff in the container, and run X11 applications in the same environment. I never taught a class with it but I used to use it semi-regularly to experiment with ideas.
Quiero mantener una sesiĂłn por largo plazo (para no tener que estar poniendo el Password todo el tiempo).
Debido a que esta herramienta de twtxt tiene la intenciĂłn de que cualquier persona pueda auto-hospedar su propio twtxt.txt, vĂ que lo mĂĄs âfĂĄcilâ y universal es tener un servidor con PHP 7.3+, como un Shared Hosting.
Despliegues con Python, Go, etc. podrĂan requerir mĂĄs configuraciĂłn.
Quiero mantener una sesiĂłn por largo plazo (para no tener que estar poniendo el Password todo el tiempo).
Debido a que esta herramienta de twtxt tiene la intenciĂłn de que cualquier persona pueda auto-hospedar su propio twtxt.txt, vĂ que lo mĂĄs âfĂĄcilâ y universal es tener un servidor con PHP 7.3+, como un Shared Hosting.
Despliegues con Python, Go, etc. podrĂan requerir mĂĄs configuraciĂłn.
bueno, me he entretenido un montĂłn creando un CLI en Python para los OTP pues el que usaba hecho en Go, se ha quedado muy corto.
Con ayuda de ChatGPT para encender una chispa, y unas bĂșsquedas para corregir cosas, ha quedado en una hora. đ€
bueno, me he entretenido un montĂłn creando un CLI en Python para los OTP pues el que usaba hecho en Go, se ha quedado muy corto.
Con ayuda de ChatGPT para encender una chispa, y unas bĂșsquedas para corregir cosas, ha quedado en una hora. đ€
According to the RedMonk programming language rankings from Jan 2023, Go and Scala are tied at 14th place đ
1 JavaScript
2 Python
3 Java
4 PHP
5 C#
6 CSS
7 TypeScript
7 C++
9 Ruby
10 C
11 Swift
12 Shell
12 R
14 Go
14 Scala
16 Objective-C
17 Kotlin
18 PowerShell
19 Rust
19 Dart

The EUâs Proposed CRA Law May Have Unintended Consequences for the Python Ecosystem (as well as the entire free software movement).
I played around with parsers. This time I experimented with parser combinators for twt message text tokenization. Basically, extract mentions, subjects, URLs, media and regular text. Itâs kinda nice, although my solution is not completely elegant, I have to say. Especially my communication protocol between different steps for intermediate results is really ugly. Not sure about performance, I reckon a hand-written state machine parser would be quite a bit faster. I need to write a second parser and then benchmark them.
lexer.go and newparser.go resemble the parser combinators: https://git.isobeef.org/lyse/tt2/-/commit/4d481acad0213771fe5804917576388f51c340c0 Itâs far from finished yet.
The first attempt in parser.go doesnât work as my backtracking is not accounted for, I noticed only later, that I have to do that. With twt message texts there is no real error in parsing. Just regular text as a âfallbackâ. So it works a bit differently than parsing a real language. No error reporting required, except maybe for debugging. My goal was to port my Python code as closely as possible. But then the runes in the string gave me a bit of a headache, so I thought I just build myself a nice reader abstraction. When I noticed the missing backtracking, I then decided to give parser combinators a try instead of improving on my look ahead reader. It only later occurred to me, that I could have just used a rune slice instead of a string. With that, porting the Python code should have been straightforward.
Yeah, all this doesnât probably make sense, unless you look at the code. And even then, you have to learn the ropes a bit. Sorry for the noise. :-)
On the topic of Programming Languages and Telemetry. Iâm kind of curious⊠Do any of these programming language and their toolchains collect telemetry on their usage and effectively âspyâ on your development?
- Python
- C
- C++
- Java
- C#
- Visual Basic
- Javascript
- SQL
- Assembly Language
- PHP
Estoy practicando Ruby con el libro Head First (muy recomendado), y me doy cuenta que es bastante diferente a otros lenguajes que conozco y me gustan como Python, JS, C#. Le estoy apostando sobre Go, PHP y otros. Espero sea buena decisiĂłn
@prologic@twtxt.net Error handling especially in Go is very tricky I think. Even though the idea is simple, itâs fairly hard to actually implement and use in a meaningful way in my opinion. All this error wrapping or the lack of it and checking whether some specific error occurred is a mess. errors.As(âŠ) just doesnât feel natural. errors.Is(âŠ) only just. I mainly avoided it. Yesterday evening I actually researched a bit about that and found this article on errors with Go 1.13. It shed a little bit of light, but I still have a long way to go, I reckon.
We tried several things but havenât found the holy grail. Currently, we have a mix of different styles, but nothing feels really right. And having plenty of different approaches also doesnât help, thatâs right. I agree, error messages often end up getting wrapped way too much with useless information. We havenât found a solution yet. We just noticed that it kind of depends on the exact circumstances, sometimes the caller should add more information, sometimes itâs better if the callee already includes what it was supposed to do.
To experiment and get a feel for yesterdayâs research results I tried myself on the combined log parser and how to signal three different errors. Iâm not happy with it. Any feedback is highly appreciated. The idea is to let the caller check (not implemented yet) whether a specific error occurred. That means I have to define some dedicated errors upfront (ErrInvalidFormat, ErrInvalidStatusCode, ErrInvalidSentBytes) that can be used in the err == ErrInvalidFormat or probably more correct errors.Is(err, ErrInvalidFormat) check at the caller.
All three errors define separate error categories and are created using errors.New(âŠ). But for the invalid status code and invalid sent bytes cases I want to include more detail, the actual invalid number that is. Since these errors are already predefined, I cannot add this dynamic information to them. So I would need to wrap them Ă la fmt.Errorf("invalid sent bytes '%s': %w", sentBytes, ErrInvalidSentBytes"). Yet, the ErrInvalidSentBytes is wrapped and can be asserted later on using errors.Is(err, ErrInvalidSentBytes), but the big problem is that the message is repeated. I donât want that!
Having a Python and Java background, exception hierarchies are a well understood concept Iâm trying to use here. While typing this long message it occurs to me that this is probably the issue here. Anyways, I thought, I just create a ParseError type, that can hold a custom message and some causing error (one of the three ErrInvalid* above). The custom message is then returned at Error() and the wrapped cause will be matched in Is(âŠ). I then just return a ParseError{fmt.Sprintf("invalid sent bytes '%s'", sentBytes), ErrInvalidSentBytes}, but that looks super weird.
I probably need to scrap the âparent errorâ ParseError and make all three âsuberrorsâ three dedicated error types implementing Error() string methods where I create a useful error messages. Then the caller probably could just errors.Is(err, InvalidSentBytesError{}). But creating an instance of the InvalidSentBytesError type only to check for such an error category just does feel wrong to me. However, it might be the way to do this. I donât know. To be tried. Opinions, anyone? Implementing a whole new type is some effort, that I want to avoid.
Alternatively just one ParseError containing an error kind enumeration for InvalidFormat and friends could be used. Also seen that pattern before. But that would then require the much more verbose var parseError ParseError; if errors.As(err, &parseError) && parseError.Kind == InvalidSentBytes { ⊠} or something like that. Far from elegant in my eyes.
JavaScript : web apps
wut?! đł seriously?! đ€Šââïž
Python : small tools
Okay đ
Go: micro services
Umm bad generalization đ€Ł â Example yarnd that powers most of Yarn.social đ
Java: enterprise software
Yes! Oh gawd yes! đ€Ł And Javaâą needs to die a swift death!
C: crimes
Hmmm? đ€ I feel this one is going to have some backslash and/or go the way of âHackerâ being misconstrued to mean entirely different/incorrect things as is whatâs happening in the media (for various definitions of âmediaâ).
@movq@www.uninformativ.de I would not mind keeping a diff, if you tell me where to make the changes! I know nothing of Python, and I have spent already a couple of hours trying to make sense. I know it is there, in front of me, if only I knew Python. đ©