python

Back Open Paginator
12.12.2025 01:58
chrysn (@chrysn@chaos.social)

We're gathering momentum for slipmux, a transport of #CoAP over serial ports. That specification allows #embedded developers on simple boards that just have a UART to use the same tools with it as for talking to devices across the Internet. This includes security: I guess I just sent the first encrypted request over slipmux ever, and its security setup was unmodified from #ArielOS's CoAP example.
Implementation is available in #RiotOS (#C), and WIP for Ariel (#RustLang) and #aiocoap (#Python).





Show Original Post


12.12.2025 00:07
zolaris (@zolaris@mastodon.illumos.cafe)

I have a #firewall ruleset defined for all of my VMs, but it always bothered me that they didn’t share the same syntax, formatting, ordering, etc. I figured I could reduce the complexity and solve all of these inconsistencies by modularizing my firewall rules. Ideally, I wanted something like:

```
import enable_ssh_in
```

which would inject the corresponding rule fragment into the ruleset. Some modules would also need light post-processing such as filling in port numbers, selecting protocols, and similar adjustments.

Unfortunately, #IPF can’t handle rule imports, so the next best option is to pre-bake the full ruleset and hand the final result to IPF.

My first attempt was with m4, but the result was messy and triggered my #OCD. Then I tried doing it in #Python, and the outcome is much cleaner.

Now I can write a simple text file like: paste.omnios.org/?97e42d30483c
Feed it through my macro processor, and it generates this: paste.omnios.org/?5db469ba780c

What do you think about this?




Show Original Post


11.12.2025 23:46
towardsdatascience (@towardsdatascience@hachyderm.io)

Go from repetitive code to a single, reusable function. Mahnoor Javed's latest tutorial teaches you how to build a function in #Python that can draw any polygon using the Turtle module.

towardsdatascience.com/drawing




Show Original Post


11.12.2025 23:37
sadrarin (@sadrarin@masto.sadrarin.com)

Como siempre, me ha llevado horas escribir una sencilla entrada en el blog.

Para quien le pueda interesar, cómo crear un bot en Python para descargar el audio de vídeos de Youtube y similares, con yt-dlp y Mastodon:

blog.sadrarin.com/2025/bot_yt.

#python #bot




Show Original Post


11.12.2025 23:16
reddit_tech_vn_bot (@reddit_tech_vn_bot@mastodon.maobui.com)

🌟 KIẾN TẢO SỞ CỦA STARTUP QUANT TỰ ĐỘNG CHỈ 5USD/THÁNG! 🌟
Strategy Grade xây dựng nền tảng backtest dựa trên độ bền vững thống kê - không phải lợi nhuận đơn thuần. Sử dụng Next.js + Supabase + Python chạy trên Railway giá siêu rẻ ($5/tháng). 12,000 mô phỏng/ngày kiểm tra chiến lược bằng 50 permutation Monte Carlo, tự động hóa 100%. Gói cao cấp 29USD/tháng mở khóa mã & log giao dịch. #QuantitativeFinance #SaaS #StartupVietNam #Python #Nextjs

reddit.com/r/SideProject/comme




Show Original Post


11.12.2025 23:16
reddit_tech_vn_bot (@reddit_tech_vn_bot@mastodon.maobui.com)

Tạo ứng dụng bàn máy để huấn luyện mô hình GPT từ đầu! 🚀 **nous** giúp bạn tùy chỉnh transformer-based LLM (như mini-GPT) bằng Python + JAX, không cần dịch vụ đám mây. Bao gồm mô hình tiền huấn luyện 77M tham số, hỗ trợ Metal/CUDA. Rất tiện cho học hỏi và thử nghiệm! #AI #ML #TríTuệNhânTạo #MôHìnhGPT #Python #JAX #LậpTrìnhMáyHọc

reddit.com/r/SideProject/comme




Show Original Post


11.12.2025 23:02
PythonPeak (@PythonPeak@mastodon.social)

Dictionary Key Typo Trap

This Python Bug Will Make You Debug for HOURS! 🐛💀

Typos in dictionary keys that create silent bugs? This is a debugging nightmare!

🚫 What NOT to do:
• Use string keys prone to typos
• No validation of dictionary access
• Silent KeyError failures

✅ The right way: Use enums, constants, or dataclasses

Type safety prevents bugs! This Code Crimes shows why key management matters.

...

youtube.com/watch?v=s-1CpEtpQ2A




Show Original Post


11.12.2025 22:51
peterdrake (@peterdrake@mstdn.social)

New Pythonorama page just dropped: higher-order functions.

github.com/alainkaegi/pythonor

#python #pythonorama #lambda #ComputerScience




Show Original Post


11.12.2025 22:33
AFoucart (@AFoucart@social.sciences.re)

#adventofcode en #python, jour 10, suite

Toujours pas de solution à la partie 2. Je n'arrive pas à contraindre suffisamment l'espace des solutions. Je sais que je pourrais trouver les solutions algébriquement et qu'il y a des solveurs Python qui feraient sans doute ça très bien, mais normalement dans les Advent of Code il y a toujours moyen de s'en tirer sans sortir l'artillerie lourde, donc j'ai du louper quelque chose.

Tant pis, je m'attaquerai au jour 11 demain avec un jour de retard.

Point positif, j'ai découvert la librairie heapq en Python, que je ne connaissais pas. Un puzzle où on a appris quelque chose est-il vraiment raté?

notes.adfoucart.be/aocode25/da




Show Original Post


11.12.2025 22:16
jeff (@jeff@phpc.social)

I've completed "Reactor" - Day 11 - Advent of Code 2025

I spent a while severing bottleneck edges in Part 2 before remembering the trick to past problems like this. The result is a couple lines and ~30ms.

github.com/jstanden/advent-of-

#AdventOfCode #Python #Programming




Show Original Post


11.12.2025 22:01
alrj (@alrj@hostux.social)

Looks like I have a solution in #python for the second part of day 10.

The code is very much NOT-pythonesque, as I have tried to prepare it for the translation to #TurboPascal. This solution also shouldn't need much memory space at all.

It remains to be seen how long the 8088 will need to solve the few systems with a very large amount of combinations of free variables. But that will be for the weekend.

#AdventOfCode




Show Original Post


11.12.2025 21:46
treyhunner (@treyhunner@mastodon.social)

To check for a prefix or suffix, use the string startswith or endswith methods.

Read more 👉 trey.io/dley4p




Show Original Post


1 ...830 831 832 833 834 835 836 837 838 839 840 ...1575
UP