python

Back Open Paginator
18.01.2026 19:50
h4ckernews (@h4ckernews@mastodon.social)

Xenia – A monospaced font built with a custom Python engine

github.com/Loretta1982/xenia




Show Original Post


18.01.2026 19:46
treyhunner (@treyhunner@mastodon.social)

Python Tip #18 (of 365):

Merge iterables using asterisks: [*first, *second]

To merge iterables, don't do this:
third = list(first) + list(second)

Do this:
third = [*first, *second]

Two reasons I recommend this:
1. It's faster (no need to make 3 new lists instead of 1)
2. "There's a special syntax for that" usually indicates that it's more idiomatic

Remember my recommendation AGAINST using [*old] to copy a list (tip 13)?

"*" isn't for copying so much as merging




Show Original Post


18.01.2026 19:43
CuratedHackerNews (@CuratedHackerNews@mastodon.social)

Show HN: Xenia – A monospaced font built with a custom Python engine

github.com/Loretta1982/xenia




Show Original Post


18.01.2026 19:19
reddit_tech_vn_bot (@reddit_tech_vn_bot@mastodon.maobui.com)

Chỉ 5 phút tạo mẫu SaaS nhờ Python + Streamlit + Gemini API. Mỗi khi có ý tưởng, mình viết script Python, dùng Streamlit làm giao diện, gọi Gemini API để thử nhanh. Bạn có cách nào tương tự? #SaaS #Python #Streamlit #GeminiAPI #khởi_nghiệp #tech #đánh_giá

reddit.com/r/SaaS/comments/1qg




Show Original Post


18.01.2026 18:38
ehmatthes (@ehmatthes@fosstodon.org)

#Python people, which type checker are you you using?

I just tried ty, and was really surprised at how much more output it generates than mypy. There's so much output, I think I prefer what mypy generates.





Show Original Post


18.01.2026 18:21
h3techdev (@h3techdev@mastodon.social)

Henderson & Morris coined "lazy evaluation" in 1976. Almost 50 years later we're still figuring out how to do it without a garbage collector. speakez.tech/blog/seqing-simpl




Show Original Post


18.01.2026 18:16
reddit_tech_vn_bot (@reddit_tech_vn_bot@mastodon.maobui.com)

Mới! Notebook Python minh họa RLVR kết hợp GRPO, được triển khai từ đầu trong dự án Reasoning‑from‑Scratch. Tài liệu chi tiết, ví dụ thực tế cho các nhà nghiên cứu RL. #AI #MachineLearning #RL #GRPO #Python #CôngNghệ #TríTuệNhânTạo

reddit.com/r/LocalLLaMA/commen




Show Original Post


18.01.2026 18:05
villares (@villares@pynews.com.br)

10000 steps of walker that turns 30° one way if the step is prime and 30° the other way. #genuary #genuary18 #genuary2026
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


18.01.2026 17:58
TechKeysX (@TechKeysX@mastodon.social)

S1 EP17 Lab 5 - Machine Learning in Python - Python Sets Cannot Change - But You Can Add





Show Original Post


18.01.2026 17:38
TechKeysX (@TechKeysX@mastodon.social)

How to solve combined logical operators in one line code - S1 EP02 P8





Show Original Post


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

If your #Python #Pandas dataframe has a datetime index, use a slice to retrieve rows in a certain time period:

taxi_df.loc['2025-11-01':'2025-11-03']

But if the rows are unsorted? You get a KeyError.

Solution:

taxi_df.sort_index().loc['2025-11-01':'2025-11-03']





Show Original Post


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

If a text column #Python #Pandas data frame uses lots of memory and repeats, make it a category:

df['x'].memory_usage(deep=True)
# result: 8,093,417

df['x'] = df['x'].astype('category')

df['x'].memory_usage(deep=True)
# result: 154,853

A 99% savings!





Show Original Post


1 ...630 631 632 633 634 635 636 637 638 639 640 ...1584
UP