gyptazy.ch is a Fediverse instance that uses the ActivityPub protocol. In other words, users at this host can communicate with people that use software like Mastodon, Pleroma, Friendica, etc. all around the world.

This server runs the snac software and there is no automatic sign-up process.

Admin email
contact@gyptazy.ch
Admin account
@gyptazy@gyptazy.ch

Search results for #python

Rob Carlson boosted

Ned Batchelder »
@nedbat@hachyderm.io

Remember that dicts can have tuples as keys! Consider a dict with (x,y) keys instead of nested lists for a grid. It simplifies sparse grids, "resizes" are automatic, it doesn't matter where (0,0) is, and you can use negative positions:

Defining helper functions for printing a 2D board.  Full text at https://gist.github.com/nedbat/42cec00e2f03868dc5791ac0b86e68baAdding more to the board in flexible ways.  https://gist.github.com/nedbat/f22b03f70ceb9686881c4bcd442fad11

rvstaveren »
@rvstaveren@mastodon.online

I see newer , , versions bumped much faster as the default version on , but is still stuck at 3.9 :(

Kyle Taylor boosted

Rami Krispin »
@ramikrispin@mstdn.social

(1/2) New release for skforecast 🎉

Version 0.12.0 of the skforecast Python library for time series forecasting with regression models was released this week. The release includes new features, updates for existing ones, and bug fixes. 🧵👇🏼

No descriptionNo descriptionNo description

Paco Hope »
@paco@infosec.exchange

Anybody want to do a small, paid open source development job? (feel free to boost) I am not offering huge amounts of money (maybe $200 or so?) but it's also a small job. Feel free to tell me this is not reasonable.

<h3>The job:</h3>

I use HetrixTools to monitor some servers. They offer an open-source shell script that, if you run it, connects to their API and sends detailed information, not just "we can ping your server."

That shell script supports only and relies on Linuxisms (like reading /proc a lot). It does not support . My goal is to get detailed server monitoring on FreeBSD via the HetrixTools API.

I've started rewriting it in and there's a code repo where I've already done a bunch of work. I'm looking for someone to pick it up and take it over the line.

<h3>Scope</h3>

Scope of the job would be to finish the work so that, when run interactively at a command line, it runs in the foreground in an infinite loop, collecting data, reporting it up through the HetrixTools API, and then sleeping.

I'll take on the work of packaging, making it a daemon, a FreeBSD service, and such. I'm just trying to outsource the final bits of python coding, and testing against the HetrixTools API.

Code will be released open source. I'm currently using BSD 3-Clause, but I am willing to adjust to GPL or whatever.

If you're interested, DM me. I can negotiate price a bit, but not a ton.

Luciano Ramalho »
@lr@ciberlandia.pt

3️⃣ razões para conhecer o pythonfluente.com:

0️⃣ sem “Hello World”: livro intermediário/avançado para dominar 3.10+ e sua biblioteca padrão.

1️⃣ tradução PT-BR da 2ª edição de Fluent Python (O’Reilly 2022) ⭐️⭐️⭐️⭐️⭐️, publicado em 9 idiomas

2️⃣ 💯% grátis CC-BY-ND na Web, HTML: pythonfluente.com, fontes: & : github.com/pythonfluente/pytho

Captura de tela da Amazon.com mostrando a capa de Fluent Python Second Edition (O’Reilly) com 4.8 estrelas após 376 avaliações.

Hacker Public Radio » 🤖
@hpr@botsin.space

New Episode: hpr4112 :: JSON and VENDORS and AUTH ohh my!

Hosted by operat0r on 2024-05-07 is flagged as Explicit and is released under a CC-BY-SA license.

Tags: , .

hackerpublicradio.org/eps/hpr4

mgorny-nyan (he) 🙀🚂🐧 »
@mgorny@social.treehouse.systems

Time for your daily dose of complaints. Yep, the ecosystem is doing great.

depends on tokio-tar library. Tokio-tar is broken on , doesn't have a bug tracker (!) and seems to be quite dead, with a bunch of PRs ignored since 2022 (last activity mid-2023). Nevertheless, I've filed a PR to fix PowerPC, with little hope that it'll be merged, released and that we could get UV working on PowerPC.

On top of that, it seems that tokio-tar was forked in early 2021 from async-tar. It doesn't seem to have synced the few commits from 2021, and async-tar is dead since late 2021. But at least it has a bug tracker to keep track of how dead it is.

Rewriting stuff in Rust is great. Maintaining it afterwards for the sake of reverse dependencies isn't.

github.com/vorot93/tokio-tar/p

scovl »
@lobocode@hachyderm.io

@kerfuffle dominates at work. There, I work mainly in and

dcz »
@dcz@fosstodon.org

A part of that doesn't get mentioned but is a ridiculous quality of life boon:

dbg!()

Just #[derive(Debug)] on a struct and print it. Suddenly you get insight into what's going on. Very rarely do you need to write your own print.

Insert a dbg in the middle of anything

let diffi = debug!(diffs).iter();

and you get a message with line number and the name of variable:

[src/lib.rs:192:19] diffs = [16, 86, 11]

Not even has that!

Joel Carnat ♑ 🤪 »
@joel@piou.foolbazar.eu

That whatever was supposed to unleshed my graphics card. But on none of the 5 Linux distros were I installed a bunch of the things listed in the doc and running the magic spell could I get anything else than « you’re probably still rendering using cpu »…

Rami Krispin »
@ramikrispin@mstdn.social

Thanks to @medium Staff for selecting my recent article - Introduction to Multi-Stage Image Build for Python 🐍, for a boost ❤️!

This tutorial provides a step-by-step guide for converting a regular Python Dockerfile into a multi-stage build 🚀.

🔗: medium.com/towards-data-scienc

No description

Profoundly Nerdy »
@profoundlynerdy@bitbang.social

@mischa @AFresh1 I 1000% agree with this: the `use vX.XX` pragma is underappreciated. Baring (rare) changes in default behavior scripts seem to need much less maintenance than their or (worse) counterparts.

In Perl and I'm never version locked by the interpreter.

meka »
@meka@bsd.network

Do I have any experts on my line? I can't find where's the problem with (no) caching in a downstream library: github.com/encode/databases/is

If you, my dear reader, have any hint, even stupid ones, I'm all ears and willing to try anything!

Felix Palmen 📯 »
@zirias@techhub.social

@jhx @stefano @jcamos @cuddle I'll just finish coding C++ for today. I'm not even sure it's C++ or just "whatever the f** I need to use for a with as much non-GUI stuff done in pure as possible" 😎

Not a huge fan of either, I never liked "syntactic whitespace", and observing the drama trying to get rid of python2 (impossible because breaking changes in 3 and upstreams unable to adapt their build(!) scripts) didn't really change my mind 😂

For me, it's . And, yes, shell script. Sometimes amazing what *can* be done, although I admit it isn't perfectly readable 🙈
github.com/Zirias/qxmoji/blob/

Felix Palmen 📯 »
@zirias@techhub.social

@jhx @stefano @jcamos @cuddle I'll just finish coding C++ for today. I'm not even sure it's C++ or just "whatever the f** I need to use for a with as much non-GUI stuff done in pure as possible" 😎

Not a huge fan of either, I never liked "syntactic whitespace", and observing the drama trying to get rid of python2 (impossible because breaking changes in 3 and upstreams unable to adapt their build(!) scripts) didn't really change my mind 😂

For me, it's . And, yes, shell script. Sometimes amazing what *can* be done, although I admit it isn't perfectly readable 🙈
github.com/Zirias/qxmoji/blob/

Felix Palmen 📯 »
@zirias@techhub.social

When even thinking about writing your *own* , the first challenge is to convert a textfile to some source for your programming language (to have all the emoji data available):
unicode.org/Public/emoji/15.1/

I've seen people use for that 🙄 ... I'd assume might be a popular choice as well, or maybe oldschool ... or whatever "fancy" scripting language.

Well, it's nothing good old can't do! 😏

A first draft fed each and every line to , and (surprise) was slow as hell, but turns out simple shell patterns are sufficient for the job as well 😎

edit: with all the text parsing in sh, a "hammer-nail-issue" sneaked in 🙈 screenshot replaced, simply use a "for" loop where appropriate 😂

No descriptionNo description

Laurent Cheylus »
@lcheylus@bsd.network

Using uv (an extremely fast Python package installer and resolver written in Rust) instead of pip, Home Assitant project can save around 5 hours of execution time on each build developers.home-assistant.io/b

Dirk Van den Poel »
@dirkvandenpoel@mastodon.online

Informing graduates at the job fair about studying “Data Science for Business” at Ghent University, Belgium. mma.ugent.be

Tara Stella 🌷 »
@tara@hachyderm.io

... because the day wasn't shitty enough... 🙄 👩‍💻

I found out that from Python 3.11, you are forced to use virtualenvs. These are ok, but what about all those Python programs installed as a package (or brew) that do not and require a Python package that is not packaged?

github.com/orgs/Homebrew/discu

unruhe »
@unruhe@mastodon.social

ho installato con gestione sulla mia amata 14.0-p5 oramai i miei server funzioneranno solo con FreeBSD, è un altro pianeta, basta distribuzioni basate su RedHat dove per installare una fetente di libreria devi per forza usare pip. Librerie per niente arizigogolate che trovi su ArchLinux come su FreeBSD ma non in Rocky Linux e compagnia cantando. Dovrei mettere tutto il codice scritto da me in python e bash su ?

Kyle Taylor »
@kta@hostux.social

Wonder how long it will take to get it rolled into BLAS/LAPACK and into and .

"It is the biggest improvement in matrix multiplication we've seen in more than a decade."...

[1] arstechnica.com/information-te
[2] docs.scipy.org/doc/scipy/tutor
[3] stackoverflow.com/a/11421344

Andreas Scherbaum »
@ascherbaum@mastodon.social

I have a script which is modifying files, and output some text. All very generic. This will not be a standalone Python class.

What is a good way to have tests for this script?

Seems like the Python test frameworks all only test single classes, not more complex examples. And while I might be able to test functions, I might miss more details when not testing the overall functionality.

Annie »
@Anniiii@gts.ferreo.dev

Ah I "love" it, wanted to just deploy some app on my server that would be useful for me: backend, frontend, so far so good. Well as it turns out their vue frontend uses in the build process and rollup refuses to build on .. HOW.. get your shit together devs.. I shouldn't need to be on a specific operating system to build the fucking frontend.. I get it if your lazy ass can't write portable code, so the backend won't work on anything except your crappy docker container because with all the custom environment stuff it would implode on any real system (I'll still yell at you for it, but that at least remotely makes sense how it happens) but THIS?

Veronica Olsen 🏳️‍🌈🇳🇴🌻 »
@veronica@mastodon.online

Ok, it's a little obvious I wrote these tests while watching "For All Mankind". 😅

A screenshot of Python code. The code is a series of tests where the text "Hi Bob" is frequently used.

Brendan »
@brendan@mastodon.brendans-bits.com

@homeassistant

If you're managing HA Core in a FreeBSD jail, I've made some notes about a way to manage the Python virtual environments and upgrade to new releases of HA.

blog.brendans-bits.com/posts/2

mmu_man »
@mmu_man@m.g3l.org

Moment surréaliste : Ça parle de dans La Grande Librairie sur TV5…

Capture d'écran de l'émission, montrant l'autrice, et du code Python côte à côte.Vue du plateau.

waldi »
@waldi@chaos.social

Weird code

Python dataclasses are nice. Added some generic code to read and write deb822 style files.

salsa.debian.org/kernel-team/l

KubikPixel™ »
@kubikpixel@chaos.social

uv: Python packaging in Rust

uv is an extremely fast package and resolver, written in , and designed as a drop-in replacement for and pip-tools workflows.
– by @charliermarsh

astral.sh/blog/uv

Jan ☕🎼🎹☁️🏋️‍♂️ »
@jan@fedi.kcore.org

There's a schism in our team: two people who write high level code with lots of abstractions that only those two really get.

The majority of the team consists of people who are infrastructure people who write code as part of their job. This code is generally a lot simpler, perhaps less optimal.

When confronting the people who write the academic-level-code, they defend their thing to no end, not listening to the concerns of the other people. When the PRs are blocked as a result of the disagreement, they start whining.

It makes me long for simpler days.

DesRoin »
@DesRoin@geekdom.social

Thing is, my knowledge is still limited. I did use the original 1 back in the days running ARMedslack (SlackwareARM nowadays) which was heck of a lot of work to get it running.
However I've only used it for a University project so I stopped tinkering once , and a proper web server were running on it.
Used it to read and store data from a SmartMeter to then provide plotting via web for it. That was the sh*t back in the days ^^

mgorny-nyan (he) 🙀🚂🐧 »
@mgorny@social.treehouse.systems

Today in : I've finally tried figuring out why we have so many test failures in with . Well, I haven't figure out much — except that pip doesn't respect the temporary test directories somehow (i.e. it's seems to be a bug specific to Gentoo/PyPy, not intentional behavior), and instead wreaks havoc in the venv it installed to. Sigh.

github.com/pypa/pip/issues/125

Reimar Bauer »
@ReimarBauer@ruhr.social

Für 2 Python-Barcamps python-verband.org/events/
Könnt ihr euch schon Plätze sichern.

Reimar Bauer »
@ReimarBauer@ruhr.social

Django migrations, friend or foe? Optimize them for testing

There are still places free in the dev room.

No description

mgorny-nyan (he) 🙀🚂🐧 »
@mgorny@social.treehouse.systems

Fun bug in discovered while debugging a ( generator library) test failure on with libc.

SegNo defaults to attempting to encode strings as ISO-8859-1 if possible. ZBar defaults to trying to decode them as Big5 first. Most of the time everything works fine.

Let's take a test string from ZBar: "Märchenbücher". When we encode it as ISO-8859-1, we're going to get two high-byte, low-byte sequences: E4 72 for "är" and FC 63 for "üc". The latter sequence maps to a "user defined" character in Big5, and therefore glibc refuses to convert it. However, musl converts it just fine. As a result, ZBar decodes the string as Big5, to "M酺chenb𡡷her".

You could argue that musl behaves wrong. However, note that the former sequence is valid in Big5. So if you shorten the string to just "Märchen", glibc would happily decode its ISO-8859-1 as Big5, giving you "M酺chen". And yes, if I put that test string into SegNo, I get a QRCode that reproduces the problem on a glibc system.

Does ZBar behave wrong here? Or perhaps SegNo should avoid ISO-8859-1 altogether, and use safer UTF-8 encoding?

bugs.gentoo.org/923233
github.com/heuer/segno/issues/
github.com/mchehab/zbar/issues

0 ★ 0 ↺

gyptazy »
@gyptazy@gyptazy.ch

0 ★ 0 ↺

gyptazy »
@gyptazy@gyptazy.ch

Just arrived at ( in .
Trust we'll see some great talks in related topics! Happy to see you all!

PS: Still enough parking slots available in P3!


Andreas Scherbaum »
@ascherbaum@mastodon.social

My blog is running with , and I have a script which runs as pre-commit and checks all files.

Things like:
* certain keywords are cursive
* certain tags exist, based on content
* invalid links
* http links
* code blocks are marked
* preview image exists
* preview text exists
* ... some more

Is this something other people are interested in? Then I make the script configurable, and more formal.

Laurent Cheylus »
@lcheylus@bsd.network

What’s the difference between the dict type and {} literal expression for ? - Code and Performance Analysis (TLDR: The {} is always faster than dict) - Blog post by Kamil Rusin @nathiss madebyme.today/blog/python-dic

Kyle Taylor »
@kta@hostux.social

I find myself coming back to this paper / talk from Maciej Czekaj on using for data science. For the uninitiated, a modern data science software stack is large and unwieldy. Running jupyterlab out of ports and jails can take you 90% of the way there. And do it in a way that is secure / stable. I use VM's and for some of the stuff he touches on. And not much on (which he goes into). But the discussion on is spot-on.

papers.freebsd.org/2022/bsdcan

phiofx »
@phiofx@hachyderm.io

@sirber @amin scratch the mighty and invariably you find some C/C++ lib that is as high performance as can get. Case in point the lib for parsing whatever you fetch from the web...
pypi.org/project/lxml/

Where python speed will let you down performance wise is if you write "naive" code for a computationally intense task and dont use something like , etc.

mgorny-nyan (he) 🙀🚂🐧 »
@mgorny@social.treehouse.systems

is true quality software. It even comes with a time bomb that makes old versions suddenly stop working in 2024:

github.com/saltstack/salt/blob
922584.bugs.gentoo.org/attachm

(spotted by matoro, thanks!)