python

Back Open Paginator
19.02.2026 20:07
TechKeysX (@TechKeysX@mastodon.social)

What is a Tuple in Python explained - S1 EP05 P7 -





Show Original Post


19.02.2026 20:04
TechKeysX (@TechKeysX@mastodon.social)

Five Basic Methods to Inspect and Work With Lists in Python - S1 EP05 P6 -





Show Original Post


19.02.2026 19:51
djangocon (@djangocon@fosstodon.org)

📣 DjangoCon US 2026 is coming to Chicago and we want YOUR talk! Whether you're a first-time speaker or a seasoned pro, we'd love to hear your ideas about Django, Python, and the web.

CFP closes March 16 at 11am CDT
pretalx.com/djangocon-us-2026/

#DjangoConUS #Django #Python





Show Original Post


19.02.2026 19:32
mopicmp (@mopicmp@mastodon.social)

Python Tip: Context Managers

from contextlib import contextmanager

@contextmanager
def timer():
start = time.time()
yield
print(f'Took {time.time()-start:.2f}s')

with timer():
heavy_computation()

Create your own context managers with @contextmanager. Clean resource management and timing.

raccoonette.gumroad.com/l/Pyth




Show Original Post


19.02.2026 19:32
mopicmp (@mopicmp@mastodon.social)

Python Tip: pathlib > os.path

from pathlib import Path
config = Path.home() / '.config' / 'app.json'
if config.exists():
data = config.read_text()

pathlib provides an object-oriented filesystem API. Cleaner than os.path string juggling.

raccoonette.gumroad.com/l/Pyth




Show Original Post


19.02.2026 19:01
scy (@scy@chaos.social)

Is there easy to use open-source face tracking software that I can hook up to my webcam and it can tell when I blink? I'd like to track how often I'm doing that, because I suspect it's not often enough.

#Python preferred.




Show Original Post


19.02.2026 18:59
bjarne (@bjarne@social.bvoigtlaender.de)

/IM FULL OF JOY.

After, I have visited one of the few arcades in my city. I was fairly disappointed by the game choice. The biggest problem is that most of the newer games play themselves. One was a racing game, and it almost made no difference if you drove straight into a wall or not. You were also bombarded by fancy items. Suffice to say, that I have stayed the remainder of my stay at the pinball machines. I actually never played pinball and was pleasantly surprised how fun it is. My training in 3D Pinball actually paid off, big time.

The reason why I am so joyful is that I have naturally thought about making my own arcade, after seeing in what disastrous state they are (at least here). My first test was if it was feasible to make a GPIO controller I could use to play native games on Linux, and it was such a breeze!!! :fall: After a quick search, I found python-evdev, which I could easily install thanks to apt and the Raspbian repository. I remember that I always had trouble with Python, but it's so cool to be able to do everything just using apt, and if some dependency is missing, I could easily enable a virtual environment with pip. It even told me that when I tried to do it wrong the first time around! All python-evdev does is inject input right into the kernel of Linux! This is so awesome! I'm amazed at how stupid simple it is. Only been using Linux for a year or so, but every time I learn how smart it is, I am overwhelmed with joy. I wrote a couple of lines of Python, shown below, and was able to create a virtual controller. Running evtest, I was able to see the controller and its inputs, but most critically, when running supertux2, Tux was jumping!

Next up I have to hook up the buttons via GPIO. I already found a library I could use to talk with it more easily https://gpiozero.readthedocs.io.

It's really hard for me to express how happy I am about all those tools we have available, and how well they fit together. It's amazing how I am able to create a virtual controller just from some lines of code, without any drivers that have to be installed in every corner of the OS. Love Python, Love Linux, Love python-evdev and I also still like the Raspberry.

from evdev import UInput, ecodes as e
from time import sleep
capabilities = {
    e.EV_KEY: [
        e.BTN_A
    ]
}

ui = UInput(capabilities, name="VirtualController", vendor0x1234, product=0x5678)

while (True):
    ui.write(e.EV_KEY, e.BTN_A, 1)
    ui.syn()
    sleep(1)
    ui.write(e.EV_KEY, e.BTN_A, 0)
    ui.syn()
    sleep(1)

#linux #python #hardware #hacking #rpi #project #opensource




Show Original Post


19.02.2026 18:50
frehi (@frehi@fosstodon.org)

Hm, pip-audit is not available in Debian.

#debian #python #pip #audit #infosec




Show Original Post


19.02.2026 18:47
AAKL (@AAKL@infosec.exchange)

New.

Recorded Future: 2025 Cloud Threat Hunting and Defense Landscape recordedfuture.com/research/20

Kaspersky: Arkanix Stealer: a C++ & Python infostealer securelist.com/arkanix-stealer @Kaspersky

Proopoint: (Don't) TrustConnect: It's a RAT in an RMM hat proofpoint.com/us/blog/threat-

From yesterday:

Wiz: Would You Click ‘Accept’? Automatically detecting malicious Azure OAuth applications using LLMs wiz.io/blog/detecting-maliciou #malware #infosec #threatresearch #Python #LLM




Show Original Post


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

Python mmap: Улучшенный I/O файлов с помощью отображение файлов в память

В Zen of Python есть много мудрых идей. Одна особенно полезная гласит: «Должен быть один — и желательно только один — очевидный способ сделать это». Тем не менее в Python существует несколько способов решить большинство задач. Например, есть разные способы чтения файла в Python, включая редко используемый модуль mmap . В этом руководстве вы узнаете: какие виды компьютерной памяти существуют; какие задачи можно решить с помощью mmap; как использовать отображение в память для более быстрого чтения больших файлов; как изменить часть файла, не перезаписывая весь файл; как использовать mmap для обмена информацией между несколькими процессами.

habr.com/ru/articles/1001546/

#mmap #python #memory_mapped_file #большие_файлы #большие_данные #работа_с_файлами #файлы #оптимизация_кода #Отображение_файла_в_память




Show Original Post


19.02.2026 17:59
ricko (@ricko@tech.lgbt)

I've spent the morning reading through typing.python.org and am feeling much more positive about relearning #Python. Less like it's a language made out of mashed potatoes and toothpicks.

If you're coming to Python from another language, I'd recommend starting there.




Show Original Post


19.02.2026 17:55
mEDI (@mEDI@nerdculture.de)

Habt ihr schon alle fleißig unterzeichnet?

openpetition.de/petition/onlin

Bitte Boosten!

#petition #deutschland #linux #opensource #kde #gnome #libreoffice #firefox #chrome #chomium #vscode #internet #thunderbird #develop #perl #python #nodejs #javascript #go #golang #ruby #rust #c #ubuntu #debian #arch #archlinux #gentoo #handbrake #gimp #Gemeinnutz #free #freespeech #freiheit #openstreetmap #osm




Show Original Post


1 ...457 458 459 460 461 462 463 464 465 466 467 ...1589
UP