python

Back Open Paginator
11.11.2025 23:16
reddit_tech_vn_bot (@reddit_tech_vn_bot@mastodon.maobui.com)

Tôi đã xây cùng một thư viện concurrency trong Go và Python, hai ngôn ngữ với trải nghiệm hoàn toàn khác nhau.

Go (gliter) sử dụng goroutines và channels cho sự ổn định, rõ ràng. Python (pipevine) với async + multiprocessing mang lại tính linh hoạt nhưng khó đảm bảo tính bền vững.

Câu hỏi được đặt ra: chúng ta có thực sự muốn concurrency dễ sử dụng, hay một số ma sát cần thiết như một rào chắn an toàn?

#programming #concurrency #golang #python #softwareengineering #lậptrình #đồngthời #go #py




Show Original Post


11.11.2025 23:11
jochie (@jochie@strangeweb.page)

A little open heart code-surgery 🥳

1: Refactor, so final part of timeline refresh can be used as call-back

2: Create permanent background thread for Mastodon.py

loop = asyncio.new_event_loop()
threading.Thread(target=loop.run_forever).start()

3: Run in background:

asyncio.run_coroutine_threadsafe(self.do_async(…), loop)

4: Use self.app.call_from_thread() to safely update Textual data

5: Exit gracefully

loop.call_soon_threadsafe(loop.stop)

#Python #AsyncIO #Programming




Show Original Post


11.11.2025 23:05
jankatins (@jankatins@fosstodon.org)

I recently needed a decorator to turn a regular @pytestdotorg fixture into one which only executes once when run with #pytest-xdist. It took me a while to figure it out, but here it is:

katzien.de/en/posts/2025-11-11

Usage:

```py
class Something(pydantic.BaseModel):
...
@pytest.fixture(scope="session")
@xdist_run_only_once(return_type=Something)
def something() -> Iterator[Something]:
yield Something(...)
```

#Blogged #python




Show Original Post


11.11.2025 23:00
lobsters (@lobsters@mastodon.social)

An Empirical Evaluation of Property-Based Testing in Python via @pushcx lobste.rs/s/5hjn9y
dl.acm.org/doi/pdf/10.1145/376




Show Original Post


11.11.2025 22:58
Allyn (@Allyn@mastodon.ie)

Made loads of progress on my matte vinyl stickers for PyCon Ireland!

These are giant removable stickers, suitable for a laptop, notepad, or water bottle.

#PyConIe #Python #PyCon #PythonIe





Show Original Post


11.11.2025 22:57
daks (@daks@mamot.fr)

I had never looked at #LSP but now I want to integrate it in my #neovim setup and I find out that there are a lot for each language… so here comes another question to #python devs: which LSP config do you use in those listed at github.com/neovim/nvim-lspconf?

#development




Show Original Post


11.11.2025 22:54
dbouquin (@dbouquin@mastodon.social)

Hope you're all champions too 🐍🫠 youtube.com/shorts/eCoTu6eigEg




Show Original Post


11.11.2025 22:38
vladimirvc (@vladimirvc@fosstodon.org)

MicroPython: An Intro to Programming Hardware in Python via @realpython
#python #programming #microcontroller
realpython.com/micropython/




Show Original Post


11.11.2025 22:38
jeremy (@jeremy@mastodon.autostatic.net)

Got into the Antagonist¹ dashboard with a small #Python script. The main goal is to be able to do DNS changes in the #Antagonist dashboard so that I can update DNS entries from the command line.

¹antagonist.nl




Show Original Post


11.11.2025 22:37
driscollis (@driscollis@mastodon.social)

How to get the minimum and maximum values of a sequence in using built-in functions.

Note that both functions also have a handy default parameter you can set if the sequences are empty





Show Original Post


11.11.2025 22:31
linuxgal (@linuxgal@techhub.social)

Print a range of unicode characters with #Python #QR

#!/usr/bin/python3
import sys
a = int(sys.argv[1],16)
b = int(sys.argv[2],16)
for i in range(a,b + 1):
print(" ".join([str(hex(i))," ",chr(i)]))





Show Original Post


11.11.2025 22:16
reddit_tech_vn_bot (@reddit_tech_vn_bot@mastodon.maobui.com)

**Tự động hóa AI "Nhà máy" Shorts bằng Python – Dự án SideProject!**
Mệt mỏi với việc chỉnh sửa Shorts thủ công, tác giả đã lập trình một AI "Factory" bằng Python tự động hóa toàn bộ pipeline từ Reddit đến Shorts (PRAW → Gemini → Whisper → FFmpeg). Video 9 phút giới thiệu chi tiết và GitHub đã được đăng.
#AI #Python #Reddit #YouTubeShorts #SideProject #TựĐộngHóa #LậpTrình #DựÁnCáNhân

reddit.com/r/SideProject/comme




Show Original Post


1 ...1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 ...1566
UP