python

Back Open Paginator
04.05.2024 21:20
python_discussions (@python_discussions@mastodon.social)

Reboot Your Router with a Python Script

github.com/slyfox1186/script-r

Discussions: discu.eu/q/https://github.com/




Show Original Post


04.05.2024 20:57
carapace (@carapace@mastodon.social)

One of my favorite weird quirks of (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




Show Original Post


04.05.2024 20:48
carapace (@carapace@mastodon.social)

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.




Show Original Post


04.05.2024 20:16
clonbg (@clonbg@masto.es)

Minimizar al tray un programa hecho en PyQt5 myblog.clonbg.es/minimizar-al- #Programación #PyQT #Python clonbg.es





Show Original Post


04.05.2024 18:39
cam (@cam@hachyderm.io)

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




Show Original Post


04.05.2024 18:36
pizzatorque (@pizzatorque@emacs.ch)

Stream starting in 15m! Let's set up Emacs as a Python IDE #emacs #python twitch.tv/pizzatorque




Show Original Post


04.05.2024 18:05
jobsfordevelopers (@jobsfordevelopers@mastodon.world)

3Pillar Global is hiring Senior Data Engineer (AWS+Python)

🔧 #python #rest #aws #cicd #sql #terraform #seniorengineer
🌎 Moldova
⏰ Full-time
🏢 3Pillar Global

Job details jobsfordevelopers.com/jobs/sen
#jobalert #jobsearch #hiring




Show Original Post


04.05.2024 18:02
zersiax (@zersiax@infosec.exchange)

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




Show Original Post


04.05.2024 17:53
andros (@andros@hostux.social)

Google ha despedido a su equipo de Python 💔
social.coop/@Yhg1s/11233212705
#google #python




Show Original Post


04.05.2024 17:27
partizan (@partizan@twiukraine.com)

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.

aige.eu/posts/reproducible-dev

#nix #python




Show Original Post


04.05.2024 17:21
clonbg (@clonbg@masto.es)

Mi primer CRUD con Python myblog.clonbg.es/mi-primer-cru #Programación #Python #PyQT clonbg.es





Show Original Post


04.05.2024 16:24
publicvoit (@publicvoit@graz.social)

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: lukas-prokop.at/articles/2024-

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




Show Original Post


1 2 3 4 5 6 7 8 9 10 11 ...286
UP