python

Back Open Paginator
07.01.2026 19:50
treyhunner (@treyhunner@mastodon.social)

Python Tip #7 (of 365):

Avoid using "or" short-circuiting for fallback reassignments.

Instead of this:
name = name or "world"

I recommend this:
if not name:
name = "world"

It's more verbose, but I find it more readable at a glance.

The first approach relies on the fact that "and" and "or" return the value of the last expression they evaluate. So name is reassigned to itself whenever it's truthy and assigned to "world" otherwise.

🧵 (1/4)




Show Original Post


07.01.2026 19:28
reddit_tech_vn_bot (@reddit_tech_vn_bot@mastodon.maobui.com)

Trình tạo nhạc AI chạy cục bộ! Dùng Python, tạo ra 4 phút nhạc chỉ trong ~20 giây. Hỗ trợ giọng hát & nhạc cụ. Lý tưởng cho game và content creator.

#AI #Nhạc #Tech #Python #LocalAI #GameDev #Nội dung số

reddit.com/r/SideProject/comme




Show Original Post


07.01.2026 19:19
TechKeysX (@TechKeysX@mastodon.social)

S1 EP15 Lab 8 - Machine Learning in Python - IPython Results - Appear Automatically





Show Original Post


07.01.2026 18:52
habr (@habr@zhub.link)

Все об устройстве Q65 с примерами на Python (часть 2)

Q65 — цифровой протокол, разработанный Джо Тейлором (K1JT) и его командой в 2021 году для проведения минимальных связей в условиях сложных трасс прохождения радиосигнала. В предыдущей части части были рассмотрены общая структура протокола и алгоритмы формирования сигнала. В этой части статьи рассматриваются принципы цифровой обработки сигналов и синхронизации в протоколе Q65. Статья может быть интересна радиолюбителям и людям, интересующимся темой цифровой обработки сигналов.

habr.com/ru/articles/983286/

#ham #hamradio #python #numpy #DSP #q65 #python3




Show Original Post


07.01.2026 18:21
uvok (@uvok@woof.tech)

I'm gonna get burned for this...

But I'm calling a python script via popen in C(++), because I can't be arsed to

- rewrite my disassembler in C(++)
- learning about Python.h

git.uvok.de/fpga-exper/tree/na

#cpp #python #interop




Show Original Post


07.01.2026 18:16
devto_vn_bot (@devto_vn_bot@mastodon.maobui.com)

Motia framework giúp phát triển backend trở nên đơn giản & "nhàm chán" bằng cách hợp nhất API routes, công việc nền/cron, workflows, state chia sẻ, và streams trong một nền tảng. Hỗ trợ TypeScript/Python đồng thời, sử dụng "step" làm đơn vị công việc cơ bản. Tiện ích với log có cấu trúc, duy trì trạng thái giữa các bước và streaming thời gian thực.

Lưu ý: Chưa kiểm chứng ở quy mô lớn, giấy phép Elastic 2.0 (không phải mã nguồn mở).

#Motia #Backend #WebDevelopment #TypeScript #Python #Develope




Show Original Post


07.01.2026 18:10
shanmukhateja (@shanmukhateja@social.linux.pizza)

I hacked together a Python + GTK project to inhibit/uninhibit sleep via a simple GUI.

This was put together in 3 hours and I am very proud of this janky code.

My blog goes into the background for this as well as its implementation.

Give it a read:

blog.suryatejak.in/sleep-stopp

#linux #gtk4 #python #linuxsleep #opensource




Show Original Post


07.01.2026 17:42
r (@r@bsky.brid.gy)

Käytin aiemmin unix_at-moduulia (python-wrapper unixin atd:lle) viivästettyihin laitetilan asetuksiin (esim valon sammuminen x min päästä). Luova mutta raskas ratkaisu. Tein vihdoin oman moduulin, joka hoitaa saman kevyemmin. Käyttää /dev/shm-hakemistoa IPC:hen. #python #ohjelmointi #kotiautomaatio




Show Original Post


07.01.2026 17:30
Reuven (@Reuven@fosstodon.org)

Create a #Python dict with keys a/b/c and values 0:

d = dict.fromkeys('abc', 0)

But don't do this, since the value will be shared and mutable:

d = dict.fromkeys('abc', [])
d['a'].append('x')
d['b'].append('y')

print(d)

{'a': ['x', 'y'], 'b': ['x', 'y'], 'c': ['x', 'y']} 🤯




Show Original Post


07.01.2026 17:26
r (@r@fed.brid.gy)

🎉 New year, new #GIS skills! ⌨️ Learn scripting in #QGIS with my free course at @gisopencourseware.bsky.social@bsky.brid.gy: no complex setup, just start from QGIS. Topics: #GDAL #CLI #Python basics #PyQGIS with the Notebook plugin ✨ 👉 courses.gisopencourseware.org/course/view....





Show Original Post


07.01.2026 17:24
hansakwast (@hansakwast@fosstodon.org)

🎉 New year, new #GIS skills!
⌨️ Learn scripting in #QGIS with my free course at @gisocw : no complex setup, just start from QGIS.

Topics:
:terminal: #GDAL #CLI
:python: #Python basics
:qgis: #PyQGIS with the Notebook plugin ✨

👉 courses.gisopencourseware.org/





Show Original Post


07.01.2026 17:07
feed (@feed@feedsin.space)

PEP 822: Dedented Multiline String (d-string)

This PEP proposes to add a feature that automatically removes indentation from multiline string literals.

python




Show Original Post


1 ...695 696 697 698 699 700 701 702 703 704 705 ...1583
UP