Show more

this Python library lets you run `import sh;"-l")` and other commands in a similar way. I had an idea about a library like this and glad to see someone already made it

I was looking into Celery for scheduling tasks but it seems pretty complicated for my use case. uWSGI has this thing called a Spooler which processes tasks from a directory (and priority can be set via numbered filenames). Could be a good simple option for queuing emails?

uWSGI's logging is so damn verbose I can't fit on my phone's screen. I took Bloomberg's blog's advice and disabled logging for anything but 4xx and 5xx errors. Now my app logs every request itself, which is probably worse for performance but the log is soooo much easier to read... This blog also suggests setting the process's name to the current URL, which makes the traffic super obvious in htop 👌

Got really excited when I found out the `typing` module has a decorator named `overload` that lets you write overloaded functions (multiple definitions of the same function with different signatures). Then I realized it's just decorative for type-checking and doesn't actually do anything 😔 Obvious in retrospect but what an exciting few seconds

This system works except: turns out I left this server on UTC so my 8:30 email is sent at 3:30am while I'm asleep 😅

I watched this PyCon talk while doing dishes and it does a great job demystifying WSGI

Spent the morning making an email queuing system so I don't send too many emails and get myself banned ... Probably going to improve on it a lot in the future. Currently crossing my fingers hoping this email arrives on Wednesday 🤞

My Flask app has 'modules' in it. So if the 'about' module is the root module, then its index will be at /. If it's not root, the same page will be at /about

Turns out if you *ever* visit /about/ and it doesn't return a 404, Firefox will never let you access /about ever again 🤦‍♀️

eading Flask source code brought weakreferences to my attention. Never heard of them before but they seem useful. A Flask instance uses a weakref for 'self' in a lambda that returns static files

main difference between iOS and Android is that Android apps have bad icons

Apparently very few URLs use :~: so we might get crying-face-delimited text selection via URLs soon

I'm working on this modular Flask template where the different sections can be rearranged, renamed, and restyled but share a lot of basic behaviours. It's either a good idea to save my time in the future or a profound waste of effort, but in either case I'm sure it'll be a good learning experience 🤗

For Tabletop Story I made a bunch of dynamic forms (where the fields aren't known until runtime). Now in this project I'm doing dynamic forms based on dynamic models 😅 Why do I enjoy this??

Python Community: often uses YAML :blobsadleft:
Python Designers: seem to like TOML :blobcatcoffee:
Python Stdlib: no TOML parser :blobfrowningbig:
Me: fuck it, I'm using JSON :happy_jitter:
Old Me: would've used literal_eval on a string inside an INI file

I always liked the relevant whitespace in Python, but now that I've been writing a bunch of HTML and JavaScript which my editor formats for me, I'm seeing the downside of no-curly-braces. The Black linter works really well but it can't fix indentation

tassaron! :tassmuffin: boosted

Using "trunk" as the default branch in git also gives you nice /tree/trunk/ URLs.

apt install python3-is-python
It's the future 😎

WSL2 Ubuntu 20.04 has two Python interpreters, one in /usr/bin and one in /bin :win3_setup:

Show more
tassaron dot com

This is Brianna's federated microblog homepage! To follow my posts, find another Mastodon instance and join the fediverse.