Hi, #Python experts...
Whenever we clean up our scratch filesystems, some users' #conda environments break (emitting the usual confusing stack spew). The users swear these environments were "being used" recently (certainly much more recently than 366 days, our cutoff for atime, and yes we have atime enabled on these filesystems, for this specific reason). Is conda and/or python doing something weird such that it depends on files existing but never actually reads or writes them?
🌘 建置支援來電及去電的 AI 電話代理人
➤ 打造您的智慧化 VoIP 通訊解決方案
✤ https://github.com/videosdk-community/ai-telephony-demo
這份 GitHub 儲存庫提供了一個開源範例,教你如何使用 VideoSDK 和 Python 建置一個能夠處理來電與去電的 AI 電話代理人。它支援多種 SIP 提供者和 AI 模型,並具備可擴充的架構,方便整合新的服務。文件詳細說明瞭安裝、設定、API 端點以及如何新增 SIP 提供者與 AI 代理人。
+ 這個專案看起來很有潛力,可以大幅簡化 AI 電話系統的建置流程。
+ 感謝作者提供瞭如此詳盡的步驟和擴充指南,讓新手也能輕鬆上手。
#AI #電話 #語音代理 #VideoSDK #Python
What's the best way to write / deploy a local criss-platform webapp. Here's what I want: (1) Web app backend - FastAPI/Python connects to local SQLite database, local voice synth server etc. (2) Static HTML front end interface, used the local API, (3) All of this runs in a Docker container, (4) On the operating system - MacOS & Linux - the user clicks the app,
launches the Docker container, starts the server, opens the web app (5) User doesnt need to have Docker installed #linux #python
Achievement unlocked:
✅ Correctly identify a bug caused by string hash randomization, by guessing
In case you didn't know: I share a Python tip via email every Wednesday. 🐍💡
In July, the tips were about:
• When functions are preferable to classes & methods
• How I use the Python documentation
• Why I use trailing commas in Python
• Why I avoid calling dunder methods
• The importance of measuring branch coverage when testing
If you'd like to read a #Python tip every week, subscribe here: https://pym.dev/newsletter 💌
Python's asyncio: A Hands-On Walkthrough
https://lemmy.world/post/33824270
Due to administrative reasons, I'm running a few minutes late, but you can catch me soon during the Python Office Hours.
Not hosted by Jeff tonight, but by the ShitPost Working Group.
Ask us for a gist if you haven't attended before!
For the kind of code I tend to write, multiprocessing.Pool is such an effective antidote to the infamous Global Interpreter Lock that I haven't had to think about using anything else in years and years ...
... but today I want to generate *two* large output files concurrently from the results of a parallelized computation and suddenly it's not good enough and the alternatives are much, much less ergonomic. Bleh.
Design patterns you should unlearn in Python
Link: https://www.lihil.cc/blog/design-patterns-you-should-unlearn-in-python-part1/
Discussion: https://news.ycombinator.com/item?id=44759085
It looks like I'll be attending @pybeach 2025! Who's joining me?
🌗 Python 設計模式:應當拋棄的五種模式 (第一部分)
➤ 擺脫舊思維,擁抱 Pythonic 的簡潔之道
✤ https://www.lihil.cc/blog/design-patterns-you-should-unlearn-in-python-part1/
本文探討了在 Python 程式設計中,許多源自 Java 和 C++ 等語言的經典設計模式(如 Singleton 和 Builder)可能不再適用,甚至會降低程式碼的可讀性和維護性。作者提出,Python 本身提供的模組化、動態特性以及函數式編程的優勢,能夠以更簡潔、更「Pythonic」的方式解決類似的問題。文章以 Singleton 為例,闡述了其在 C++ 中的必要性,以及在 Python 中僅需使用模組即可實現,並探討了延遲初始化的 closure 替代方案。
+ 終於有人點出這個問題了!很多時候為了套用設計模式反而讓 Python 程式變得複雜不堪。
+ 模組化處理 Singleton 的確很直觀,但對於需要複雜初始化邏輯的物件,Builder 模式還是有其用
#Python #設計模式 #程式設計
Библиотека для OLED1306 с русским языком на RPi
Здравствуйте люди! Я сделал библиотеку под названием "SillyOled" для работы с OLED-дисплеями SSD1306 через I2C и SPI. Библиотека может показывать текст, фигуры, бит-мапы, а также управлять дисплеем. Вот главные особенности:
https://habr.com/ru/articles/933328/
#oledдисплей #ssd1306 #raspberry_pi_pico #thonny #python #библиотека