Reboot Your Router with a Python Script
https://github.com/slyfox1186/script-repo/blob/main/Python3/reboot-router.py
Discussions: https://discu.eu/q/https://github.com/slyfox1186/script-repo/blob/main/Python3/reboot-router.py
One of my favorite weird quirks of #Python (that bites newbies sometimes) is that default args are evaluated at the time and in the scope the 'def' statement is evaluated.
That's why you gotta do e.g.:
noooooo = [(lambda n: n**k) for k in range(10)]
print(' '.join(str(p(2)) for p in noooooo))
512 512 512 512 512 512 512 512 512 512
yeeeees = [(lambda n, k=k: n**k) for k in range(10)]
print(' '.join(str(p(2)) for p in yeeeees))
1 2 4 8 16 32 64 128 256 512
1/2
I'm pretty sure this is the most elaborate default argument I've ever used. It's a dict mapping characters to type-checker functions, but we only need the __getitem__ method (a function that maps char -> func or raises KeyError.) In effect, the dict is stored in a closure of its own method! The self argument to the __getitem__() method is "filled in" when the interpreter calls __getattr__() "under the hood" of the resolution of the '.' method/attribute lookup operator here.
Minimizar al tray un programa hecho en PyQt5 https://myblog.clonbg.es/minimizar-al-tray-un-programa-hecho-en-pyqt5/ #Programación #PyQT #Python https://clonbg.es
Last night I was trying to use @api.errorhandler for a flask-restx app and I couldn’t seem to confirm that the code in the error handler was even running in any way.
Then I start looking and it’s apparently a constant problem with flask-restx that the error handlers don’t work? But also the issues seem to have been reasoned and the causes listed aren’t happening in my app.
Everything looks set up right but it doesn’t work 😩
#python
Stream starting in 15m! Let's set up Emacs as a Python IDE #emacs #python https://www.twitch.tv/pizzatorque
3Pillar Global is hiring Senior Data Engineer (AWS+Python)
🔧 #python #rest #aws #cicd #sql #terraform #seniorengineer
🌎 Moldova
⏰ Full-time
🏢 3Pillar Global
Job details https://jobsfordevelopers.com/jobs/senior-data-engineer-aws-python-at-3-pillar-global-may-2-2024-a8edf6?utm_source=mastodon.world&utm_medium=social&utm_campaign=posting
#jobalert #jobsearch #hiring
THis week's project: There's a #steam #game called #HackMud which is one of these retro-futuristic hacking simulators. With a bit of help from the devs, I was able to work out a way to retrieve game text (the game is largely text-based) from the game and provide it in an #accessible manner. The devs are certainly receptive to imrpvoing their #accessibility so my hack may not be necessary anymore some time in the future, but as of now, my little Python script which I have aptly named QuackMud will allow me to add another way to be as unproductive as possible to my life #python #HackingIt
Google ha despedido a su equipo de Python 💔
https://social.coop/@Yhg1s/112332127058328855
#google #python
Configured Nix Flakes for local development.
It's interesting alternative to pyenv, but i used it to install libvirt different from system version.
It works great, you only need to add `pkg-config` to `nativeBuildInputs`
, otherwise some python packages do not see correct library version.
https://aige.eu/posts/reproducible-development-environments-with-nix-flakes/
Mi primer CRUD con Python https://myblog.clonbg.es/mi-primer-crud-con-python/ #Programación #Python #PyQT https://clonbg.es
What happens, when you join two paths in a #programming language when the second one is an absolute one?
join("foo", "/bar")
returns "foo/bar" or "/bar"?
The wonderful @meisterluk wrote a great article about that you might want to read: https://lukas-prokop.at/articles/2024-05-03-filepath-join-behavior
I can not tell what version I'd actually prefer. There are situations where both versions would be "proper".
#Python #Golang #UNIX #POSIX #rust #C++ #CPP #Java #dotNet #Dart #Flutter #Dlang #TCL #Nim #FreePascal #PowerShell #zig