python

Back Open Paginator
29.01.2026 19:59
Reuven (@Reuven@fosstodon.org)

Gold prices have gone up recently — but by how much?

In the latest Bamboo Weekly, we use #Python and #Pandas to find out. Then we compare its price with silver, and with central banks' gold and dollar holdings.

Get data analysis puzzles every Wednesday: BambooWeekly.com





Show Original Post


29.01.2026 19:30
blotosmetek (@blotosmetek@circumstances.run)

Unsolicited Programming Suggestion (UPS)¹:
When you code a condition for executing some action every N days, think what should happen if your system is down at the time of scheduled execution. For example, this #Python example code:

if current_day == previous_day + N:
action()
previous_day = current_day

will fail miserably – your action will not happen ever again. Replacing == with >= will solve the problem – assuming you want your action to be executed as soon as possible if the scheduled time was missed. If, however, your preferred solution is to skip the missed event altogether, but execute the next event at correct time, the % (modulo) operator is your friend:

if current_day % N == 0:
action()

Of course, this holds for intervals expressed in any units, not just days, you just need to calculate your current_whatever accordingly – for example, current_hour = int(time.time()) // 3600 or current_week = int(time.time()) // (7*24*3600) .

Now you may ask "What about cron, isn't it its role to handle such things?"
Well, yes, but cron doesn't allow you to specify, for example, "every other week", and if you think this crontab entry: 0 12 */9 * * something will run something at noon every 9th day, you're in for a surprise, and you haven't read man 5 crontab carefully – at least on Debian it says:

 # Run once every 9th day, even across week, month, and year boundaries:
33 22 * * * expr $(date +\%s) / 60 / 60 / 24 \% 9 > /dev/null || echo Wax the floor.

Yes, this is what is needed to have your action actually performed on every 9th day rather than on 9th, 18th and 27th day of every month.

¹ I'll probably be posting more such #UPS based on my own or my coworkers' real life experiences…




Show Original Post


29.01.2026 19:30
lobsters (@lobsters@mastodon.social)

MicroPythonOS - The Ultimate MicroPython Operating System lobste.rs/s/zcfnh9
micropythonos.com/




Show Original Post


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

Дескрипторы Python: механизм, на котором держится половина крутости языка

Дескрипторы — одна из тех фич Python, о которых многие слышали, но мало кто использует напрямую. При этом они лежат в основе @property , @classmethod , @staticmethod , слотов и даже обычного доступа к методам. Разберём, что такое дескрипторы, как их писать и когда они реально полезны. Понять механизм

habr.com/ru/companies/otus/art

#python #дескрипторы_Python #метапрограммирование #внутреннее_устройство_Python #data_descriptor




Show Original Post


29.01.2026 18:28
reddit_tech_vn_bot (@reddit_tech_vn_bot@mastodon.maobui.com)

MastodonBotVN: ArcadeDB Embedded Python hỗ trợ lưu trữ đa mô hình trong tiến trình (bảng + đồ thị + vector) mà không cần server! Tính năng nổi bật: ACID, HNSW, SQL, OpenCypher và JVM gọn nhẹ. Cài đặt: `pip install arcadedb-embedded`. Thảo luận: Phân tách vector/đồ thị hay tích hợp? #ArcadeDB #Python #AI #ThưVienMới #LocalLLaMA

reddit.com/r/LocalLLaMA/commen




Show Original Post


29.01.2026 18:09
ubuntu_touch (@ubuntu_touch@mstdn.social)

Crear una leyenda con un histograma

#Python #Matplotlib #Gauss #Histograma
#softwarelibre #Anzoategui #Lecheria





Show Original Post


29.01.2026 17:55
13 (@13@2137.social)

An E-Ink Macropad For Improved Productivity hackaday.com/2026/01/29/an-e-i
#PeripheralsHacks #Keyswitches #Macro #Macropad #Python




Show Original Post


29.01.2026 17:53
tardate (@tardate@ruby.social)

This week's @cassidoo challenge: count vowels and flip words. Using #python this time..

codingkata.tardate.com/python/




Show Original Post


29.01.2026 17:47
r (@r@bsky.brid.gy)

📢 #Oferta de #Empleo: Profesor/a de #Python Aula Digital Tech crece y buscamos un/a Profesor/a de Python apasionado/a por la enseñanza y la tecnología 🎯 ¿Qué buscamos? Buscamos a un #profesional con experiencia en Python y vocación docente, capaz de transmitir conocimientos AulaDigitalTech.com 👍





Show Original Post


29.01.2026 17:33
rogeliop (@rogeliop@techhub.social)

I'll see myself out... grab my coat...

#BadJoke #pi #Python





Show Original Post


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

#Python gotcha: Forgetting () on method calls!

d = {'a':2, 'b':4}

list(d.items()) # ✅ calls method

list(d.items) # ❌ passes method object

Result:

Error: 'builtin_function_or_method' object is not iterable

Remember: () calls the method!





Show Original Post


29.01.2026 17:28
reddit_tech_vn_bot (@reddit_tech_vn_bot@mastodon.maobui.com)

Luyện tập Python, HTML và CSS trên FreeCodeCamp nhưng nhiều bước thất bại khiến mình bế tắc! Mong anh em chia sẻ tài liệu, khóa học hữu ích hoặc sách tham khảo chất lượng. Làm sao để học hiệu quả mà không lo âu? Bức xúc quá! 🛠️ #HọcLậpTrinh #TưVấnLậpTrình #Python #HTML #CSS #CodingHelp #TechCommunity

reddit.com/r/programming/comme




Show Original Post


1 ...567 568 569 570 571 572 573 574 575 576 577 ...1586
UP