python

Back Open Paginator
09.01.2026 07:43
requiem (@requiem@masto.hackers.town)

For all its warts, the hundred-or-so lines of #Python that power my blog might be the most reliable piece of software I use, and its been barely maintained for years and years.

I've tried a few times to make it "better", but those efforts never get finished and the old version just keeps on truckin'

I realized today that it's an example of software I talk about in the book I'm working on without realizing that I'd been writing and using an example for years, maybe over a decade..

#codeworker




Show Original Post


09.01.2026 07:17
devto_vn_bot (@devto_vn_bot@mastodon.maobui.com)

✅ Học Python: Tạo công cụ chụp màn hình & phân tích video với Tkinter, MSS
Công cụ GUI này cho phép:
- Chụp màn hình real-time
- Hiển thị vectorscope, histogram màu *và luma*
- Tuỳ chỉnh vùng quan tâm (ROI)
- Lấy mã màu trực tiếp
- Ghi video MP4
Tech stack: Python + Tkinter/ttkbootstrap + OpenCV + MSS

✨ Tính năng nổi bật:
• Điều chỉnh độ lấy mẫu/gain
• Vẽ biểu đồ màu RGB và độ sáng
• Phím tắt SPACE (lấy màu), R (reset ROI)

#Python #LậpTrình #ComputerVision #OpenCV #Tkin




Show Original Post


09.01.2026 06:46
theevolvedgetechnology (@theevolvedgetechnology@mastodon.social)

#1 OT/ICS CYBERSECURITY TRAINING AND GEN AI TRAINING IN DELHI NCR AND IN INDIA



visit-www.theevolvedge.com
mail - info@theevolvedge.com
ph no :+917982403420
+919311805027





Show Original Post


09.01.2026 06:43
hynek (@hynek@mastodon.social)

Santa came super early in 2026!

With build 1.4.0, it is now possible to easily dump effective package metadata!

So getting the version of a package in the current directory is now as easy as `pipx run build --metadata 2>/dev/null | jq -r .version`.

This is NOT like parsing pyproject.toml or whatever. It builds the package and looks at the result. So it works even with setup.py.

github.com/pypa/build/releases




Show Original Post


09.01.2026 06:15
Reuven (@Reuven@fosstodon.org)

New York began congestion pricing in 2025. Also in 2025? Taxis and buses moved faster, and more people took public transportation.

We can prove it with the data — and using #Python #Pandas.

Challenge yourself with new, weekly real-world data problems: BambooWeekly.com





Show Original Post


09.01.2026 05:25
shtrom (@shtrom@piaille.fr)

Damn you, ImageMagick!

#python #imageMagick #unittest





Show Original Post


09.01.2026 04:45
lobsters (@lobsters@mastodon.social)

A Year of Typing: My NumPy Fellowship Retrospective lobste.rs/s/lvny3j
blog.scientific-python.org/num




Show Original Post


09.01.2026 04:29
mdhughes (@mdhughes@appdot.net)

Python's greatest achievement is how insane it makes anti-indentation people.

As a language, it's fine. It succeeds because it's trivial to work with a bunch of different types, or make your own that work with all the standard stuff, len & items & file streams, and it's OK at interfacing with C libraries.

But OMG, whitespace is significant! Some people don't know how to paste with indentation in their editors! What if you don't dedent and you don't have unit tests to catch it‽ PANIC!
#python




Show Original Post


09.01.2026 04:19
villares (@villares@pynews.com.br)

#genuary #genuary8 #genuary2026
Tweaking a sketch from 2022...
Find the sketch-a-day archives and tip jar at: abav.lugaralgum.com/sketch-a-d
Code for this sketch at: github.com/villares/sketch-a-d #Processing #Python #py5 #CreativeCoding





Show Original Post


09.01.2026 04:13
YesJustWolf (@YesJustWolf@hachyderm.io)

In #Python `any` and `all` are global functions that work on any `Iterable` producing elements that can be converted to `bool`. If you wanted (semantically) `find` #Find or `first` #First, they are less obvious (though specific types can provide them, such as `str.find`). `first` implies the underlying `Iterable` promises some predictable order, and there might be duplicates, and you might care about the position of the found element in the larger sequence.

So let’s talk about the idea of `find`: you do it all the time and for ordinary `Iterable`s, there aren’t one-word answers. Let’s start with (the not always) "bad" answers (I don’t want you to do them, so I won’t show code).

You could use a `for` loop and `break` on a match (remember, maybe, that `for` does have an `else`). Worse performing, you could produce a filtered list (with a #Comprehension or with the actual `filter` function), then just grab the first element. You’d test of course, for an empty list. Unlike the `for`, here you look at the whole list.

Here’s another way. I consider it more Pythonic. Given an ordered sequence `s` and a predicate `p` (or you can imagine a simple expression instead) then

`elem for elem in s if p(elem)`

…is the machinery of a comprehension or #Generator depending on what you surround it with. Parens or using it as an argument, will make it a generator.

`next(elem for elem in s if p(elem))`

Gets an iterator from the generator; initializes it, and causes it to find and return the first element of `s` that meets the requirements. If there is no match, then it raises a `StopIteration` exception. `next` takes another argument: a default. If you call it like this, instead of an exception it returns `None`:

`next(elem for elem in s if p(elem), None)`

It’s as efficient as the `for` (actually, a little better because `for` loops are slightly slower in general and also would have to save the found element for use afterwards. It reads better, to me anyway.




Show Original Post


09.01.2026 03:17
devto_vn_bot (@devto_vn_bot@mastodon.maobui.com)

"Thay vì try/except truyền thống, thư viện Valid8r (Python) sử dụng monad Maybe để xây dựng pipeline xác thực CLI. Các bước kiểm tra được liên kết qua bind(), tự động lan truyền lỗi và dừng khi gặp lỗi đầu tiên. Hỗ trợ toán tử (&, |, ~) để kết hợp điều kiện, tích hợp prompt tương tác và argparse. Ưu điểm: mã module hóa, dễ mở rộng, xử lý lỗi tập trung. #LậpTrình #Python #XửLýLỗi #FunctionalProgramming #Valid8r"

dev.to/mikelane/cli-validation




Show Original Post


09.01.2026 03:17
devto_vn_bot (@devto_vn_bot@mastodon.maobui.com)

Tìm hiểu các đường conic qua Python! Thay đổi góc cắt mặt nón bằng thanh trượt để quan sát sự biến đổi của đường cong từ đường tròn, parabol đến ellipse và hyperbol. Chương trình hiển thị đồng thời mô hình 3D và phương trình đồ thị 2D. Thực nghiệm toán học thú vị cho học sinh! #Toán #HìnhHọc #Python #ĐồThị #ConicSections #Geometry #Math #DataVisualization

dev.to/_4a5ba89166772d2/high-s




Show Original Post


1 ...686 687 688 689 690 691 692 693 694 695 696 ...1583
UP