python

Back Open Paginator
01.08.2025 19:20
GripNews (@GripNews@mastodon.social)

🌗 Python 設計模式:應當拋棄的五種模式 (第一部分)
➤ 擺脫舊思維,擁抱 Pythonic 的簡潔之道
lihil.cc/blog/design-patterns-
本文探討了在 Python 程式設計中,許多源自 Java 和 C++ 等語言的經典設計模式(如 Singleton 和 Builder)可能不再適用,甚至會降低程式碼的可讀性和維護性。作者提出,Python 本身提供的模組化、動態特性以及函數式編程的優勢,能夠以更簡潔、更「Pythonic」的方式解決類似的問題。文章以 Singleton 為例,闡述了其在 C++ 中的必要性,以及在 Python 中僅需使用模組即可實現,並探討了延遲初始化的 closure 替代方案。
+ 終於有人點出這個問題了!很多時候為了套用設計模式反而讓 Python 程式變得複雜不堪。
+ 模組化處理 Singleton 的確很直觀,但對於需要複雜初始化邏輯的物件,Builder 模式還是有其用




Show Original Post


01.08.2025 19:12
habr (@habr@zhub.link)

Библиотека для OLED1306 с русским языком на RPi

Здравствуйте люди! Я сделал библиотеку под названием "SillyOled" для работы с OLED-дисплеями SSD1306 через I2C и SPI. Библиотека может показывать текст, фигуры, бит-мапы, а также управлять дисплеем. Вот главные особенности:

habr.com/ru/articles/933328/

#oledдисплей #ssd1306 #raspberry_pi_pico #thonny #python #библиотека




Show Original Post


01.08.2025 19:10
frnmst (@frnmst@social.franco.net.eu.org)

Hugging Face Transformers Summarization Task

youtube.com/watch?v=g-WScdRk7c

#ai #summary #huggingface #transformers #python




Show Original Post


01.08.2025 19:00
jos1264 (@jos1264@social.skynetcloud.site)

Lazarus Hackers Weaponize 234 npm and PyPI Packages to Infect Developers gbhackers.com/lazarus-hackers- #CyberSecurityNews #cybersecurity #Python




Show Original Post


01.08.2025 18:59
tmb (@tmb@social.boelz.eu)

script2pyz

Convert a script with inline script metadata into an executable Python zip archive.

https://git.boelz.eu/tmb/script2pyz

#Python #pyz




Show Original Post


01.08.2025 18:56
ycombinator (@ycombinator@rss-mstdn.studiofreesia.com)

Design patterns you should unlearn in Python
lihil.cc/blog/design-patterns-
#ycombinator #python #api #fast #webframework #web




Show Original Post


01.08.2025 18:44
CuratedHackerNews (@CuratedHackerNews@mastodon.social)

Design Patterns You Should Unlearn in Python

lihil.cc/blog/design-patterns-




Show Original Post


01.08.2025 18:32
habr (@habr@zhub.link)

Как я собрал телеграм-бота через RAG-подход и сэкономил полжизни на переписках

Устал объяснять всем одно и тоже: как настроить, где найти, что выбрать. Психанул и собрал личного чат-бота в Telegram, который понимает контекст с опечатками, отвечает быстро и без пассивной агрессии (как я). Бонусом добавил шифрование логов, whitelist для доступа, историю чатов для персонализации и RAG с автообновлением базы знаний через Git. В статье — пошаговая инструкция, как запустить ИИ-бота на базе Gemma 3, подключить Ollama и Telegram.

habr.com/ru/companies/minerva_

#ai #bot #ИИ #ииассистент #чатбот #телеграм #python #код #программирование #искусственный_интеллект




Show Original Post


01.08.2025 18:29
smattymatty (@smattymatty@techhub.social)

I know I am a huge nerd because I think this is one of the most beautiful sights I have ever seen!

github.com/80-20-Human-In-The-

#coverage #testing #programming #python





Show Original Post


01.08.2025 17:28
stylus (@stylus@social.afront.org)

@pybay This ticket choice is fully awesome! I would love to see other conferences adopt the same idea.

I don't think it's in the cards for me to travel to California for #PyBay2025 but I'll be wishing you a successful conference from afar.

#Python





Show Original Post


01.08.2025 17:21
diazona (@diazona@techhub.social)

@feoh @paco If I understand correctly, pipx does the last thing too, with `pipx run`

#Python




Show Original Post


01.08.2025 17:05
glaforge (@glaforge@uwyn.net)

A proof-of-concept #ADK #AI #Agent code visualizer

glaforge.dev/posts/2025/08/01/

✨ Vibe-coded with Google #AiStudio and #GeminiCLI.
Powered by #Gemini 2.5 Pro.
Using #ReactFlow for the nice node-based UI.
Deployed on #CloudRun ☁️

⚠️ It works for both single-file #Java and #Python ADK multiagents. It doesn't work for projects spanning multiple files or directories.





Show Original Post


1 ...1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 ...1614
UP