python

Back Open Paginator
15.02.2026 20:14
TechKeysX (@TechKeysX@mastodon.social)

Three Basic Methods to remove items in Lists in Python - S1 EP05 P2 -





Show Original Post


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

Python Tip #46 (of 365):

Use non-primitive objects as dictionary keys.

The phrase "primitive types" isn't in the Python docs, but folks sometimes borrow that phrase from other language to refer to strings, numbers, & bools.

But those are NOT the only valid dictionary keys!

Any hashable object can be used as a dictionary key, including strings, numbers, and even tuples:

>>> coordinates = {(0, 1): "purple", (5, 4): "green"}
>>> coordinates[(0, 1)]
'purple'

🧵 (1/2)




Show Original Post


15.02.2026 19:32
habr (@habr@zhub.link)

Как я написал Telegram-бота для SEO-аудита и не дал ему стать инструментом для атак

Рекомендация по КДПВ: Практический гайд по созданию Telegram-бота для автоматизированного анализа сайта: broken links, базовый security-check, отчёты. Минимум теории — максимум рабочего кода.

habr.com/ru/articles/996844/

#Telegram_бот #Python #SSRF #rate_limiting #Redis #SEO_аудит #БаденБаден #pyTelegramBotAPI #DNS_rebinding #битые_ссылки




Show Original Post


15.02.2026 19:28
Ciantic (@Ciantic@twit.social)

imgui_bundle, a library for writing GUI apps with Python is amazing.

What is less amazing is that they are doing *exactly* what Wayland critics of protocol ext-zones was afraid of, misusing the reposition API to drag windows around. 🤦

In this case though, they are misusing xdg_popup as a kind of 'child window', and using reposition API when dragged. But this should be done with XDG child window without decorations.

Bug could be in #SDL or #Imgui_bundle

#Wayland #Linux #Python #ImGui





Show Original Post


15.02.2026 18:53
kantel (@kantel@mastodon.social)

Von TIC-80 lernen heißt Pyxel lernen 🤖

Zu der kleinen (Python 3-) Retrogame Engine Pyxel gibt es leider nur sehr wenige Tutorials, weder auf YouTube noch sonst in Textform irgendwo im Web. So mußte ich für meine jüngst aufgekeimte Idee, selber ein paar Tutorials zu Pyxel zu schreiben, nach anderen Quellen für eine Inspiration suchen. kantel.github.io/posts/2026021





Show Original Post


15.02.2026 18:45
247CodeGirl (@247CodeGirl@mastodon.social)

Season 1 Lesson 2 Part 6 - Your First Steps - Python Global Keyword - Explained





Show Original Post


15.02.2026 18:43
247CodeGirl (@247CodeGirl@mastodon.social)

Season 1 Lesson 2 Part 5 - Your First Steps - Python - What Are Global Variables





Show Original Post


15.02.2026 18:42
habr (@habr@zhub.link)

50 LLM-клеток пытались построить организм. Вот что получилось

Что если заменить мертвые правила «Игры в Жизнь» Конвея на крошечные нейросети? Я провел эксперимент: выдал каждой клетке свой «мозг» — LittleLM весом всего 6 килобайт — и заставил их договариваться друг с другом. Вдохновившись опытами биолога Майкла Левина, я попытался вырастить цифровой организм из 50 автономных агентов. В результате они не только построили структуру без единого центра управления, но и самостоятельно изобрели «рак».

habr.com/ru/articles/996836/

#Искусственная_жизнь #LLM #Клеточные_автоматы #Эмерджентность #Python #PyTorch #Майкл_Левин #Эволюционные_алгоритмы #Artificial_Life #Машинное_обучение




Show Original Post


15.02.2026 17:49
clayote (@clayote@peoplemaking.games)

Version 0.23.3 of #Lisien, which manages the rules and world state of your #Maxis-style sim game, fixes the Android build.

Get it on itch: clayote.itch.io/lisien/devlog/

Or in your Python interpreter: python -m pip install -U lisien elide

#lifeSim #gameDev #python #itch #itchio #aLife #artificialLife #cellularAutomata




Show Original Post


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

Why use OrderedDict if #Python dicts are now ordered?

Because equality checks order too:

d1 = {'a':10, 'b':20}
d2 = {'b':20, 'a':10}
d1 == d2 # True — dicts ignore order

od1 = OrderedDict(a=10, b=20)
od2 = OrderedDict(b=20, a=10)
od1 == od2 # False!





Show Original Post


15.02.2026 17:22
habr (@habr@zhub.link)

Монотонный стек: описание и примеры применения

Всем привет. В этой статье хотел бы рассказать о структуре данных под названием монотонный стек (monotonic stack) и разобрать несколько примеров задач в решении которых он применим. Статья может быть интересна любителям решать алгоритмические задачи, в особенности тем кто готовится к собеседованию.

habr.com/ru/articles/996802/

#python #алгоритмы #leetcode #задачи_для_собеседований #задачи_по_программированию #структуры_данных #занимательные_задачи #теория_сложности




Show Original Post


15.02.2026 17:01
PythonPeak (@PythonPeak@mastodon.social)

Python Dictionary Merge Trick That Saves Time

Watch this! Python dictionary unpacking merges dicts in one line. See how {**a, **b} works. Game changer for data processing!

#python #pythontricks #codingtips #programmingtutorial #pythondictionaries #dictmerge #dictionaryunpacking #pythonquiz #codingchallenge #pythonshorts #dictoperations #pythondata

youtube.com/watch?v=X3EWzg2vgMk




Show Original Post


1 ...479 480 481 482 483 484 485 486 487 488 489 ...1589
UP