python

Back Open Paginator
04.01.2026 19:38
david_alberto (@david_alberto@social.sciences.re)

I made a modern version of the Rotula for the 2026-2060 period. A feeling of magic at work when you find that the predicted dates match the ones found on the web, to the nearest day...

My version is made with #TeXLaTeX (TikZ) with some #Python .

I started making paper astronomical models during Covid: I didn't know such nice paper models existed...

As usual, everything you need is available on my website for download. Print & cut out the wheels and follow the instructions on the 12-page PDF. I wrote a user guide in french, and also one in english.

astrolabe-science.fr/maquette-





Show Original Post


04.01.2026 19:13
RodStephens (@RodStephens@hachyderm.io)

Use Pygame to visualize bubble sort in Python, Part 2

This part explains how the program creates its sprites and runs its event loop.

rodstephensbooks.com/bubble_so
#Python #Algorithms #Pygame #Animation





Show Original Post


04.01.2026 19:02
techbot (@techbot@social.raytec.co)

VVS Stealer Python Based Malware Targeting Discord Users

Pulse ID: 695aa660938a2c7d07084bc9
Pulse Link: otx.alienvault.com/pulse/695aa
Pulse Author: cryptocti
Created: 2026-01-04 17:41:52

Be advised, this data is unverified and should be considered preliminary. Always do further verification.

#CyberSecurity #Discord #InfoSec #Malware #OTX #OpenThreatExchange #Python #bot #cryptocti




Show Original Post


04.01.2026 18:58
pheonix (@pheonix@fosstodon.org)

You tell an llm to write function but you gotta recheck and possibly refactor it before adding it to your code base. What was even the point then huh?

#noai #llm #programming #testing #enshittification #python #golang #rust #javascript #indieweb




Show Original Post


04.01.2026 18:50
treyhunner (@treyhunner@mastodon.social)

Python Tip #4 (of 365):

If you're debugging with print() calls, use a self-documenting expression in an f-string.

>>> n = 256
>>> print(f"DEBUGGING {n**2=}")
DEBUGGING n**2=65536

Note the replacement field with = at the end.

Without = in the replacement field, the string would contain only the expression result:

>>> print(f"DEBUGGING {n**2}")
DEBUGGING 65536

With the =, the string contains both the replacement field expression and the expression result.

(1/2)đź§µ




Show Original Post


04.01.2026 18:18
uvok (@uvok@woof.tech)

In other news, I finished a disassembler for the nandgame CPU.
Using a "more proper" assembly syntax instead of this half-assed C-like syntax the game uses.

On the other hand,

inc <dest>, <register to increment>

looks weird.
I'm not sure how I want the final language to look lile...

git.uvok.de/fpga-exper/tree/na

#python #nandgame #assembler




Show Original Post


04.01.2026 18:15
TechKeysX (@TechKeysX@mastodon.social)

S1 EP15 Lab 2 - Machine Learning in Python - Why Sets Don’t Remove - Duplicates





Show Original Post


04.01.2026 18:08
mustikkasoppa (@mustikkasoppa@mementomori.social)

Loin tekstipohjaisen virtuaalilemmikki Dogen. :doge:

Väsäsin ekan tekstipohjaisen pelin ikinä. Ensin tein suunnitelman. Siinä mainitaan mm. pelin idea, toiminnot, rakenne ja tavoitteet. Valitsin ohjelmointikieleksi Pythonin. Siinä pelissä on varsinainen pelihuone ja itse Doge (olio).

Tässä oli ajatuksena opetella Pythonia omaan tahtiin. Ei haittaa yhtään jos heti ei kaikki aukea. Tästä syystä Claude Code tulee avukseni. Se lisää jokaiseen koodiriviin selitteen, notta mikä mikäkin koodi tekee ja miksi. Suomeksi tietysti.

Oon innoissani tästä. Pelin rakentaminen ei ole täysin uusi juttu mulle. Yli 10 vuotta sitten opiskelin AMKissa peliohjelmointia ja siellä tuli tehtyä pieniä 2D pelejä. Pythonia me ei tosin käytetty silloin. Tämä onkin nyt mainio tilaisuus oppia jotain uutta ja oliot ovat tuttuja ennestään Java-opinnoista.

On paljon kivempaa tehdä peliä, kun grafiikka ei ole mukana. Sopii näin niiku näkövammaiselle pelaajalle tosi hyvin.

#python #ClaudeCode #pelit #ohjelmointi #saavutettavuus




Show Original Post


04.01.2026 17:51
hugovk (@hugovk@mastodon.social)

I gave a lightning talk at a bunch of conferences in 2025 about some of the exciting new things coming in Python 3.14, including template strings.

One thing we can use t-strings for is to prevent SQL injection. I illustrated this with xkcd 327 aka “Little Bobby Tables”.

I localised most of the slides for the PyCon I was at, including this comic. Here they are!

hugovk.dev/blog/2026/localisin
.14




Show Original Post


04.01.2026 17:30
uvok (@uvok@woof.tech)

Huh, it appears the #python extension in #vscode-oss doesn't do any linting.
Probably because it's the MS extension?




Show Original Post


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

#Python is all about consistency. For example, sequences (string/list/tuple) all support:

s[i] # get 1 item
s[start:finish] # get slice
'a' in s # search
s.index('a') # where is a?
s.count('a') # how many as?

for item in s: # iterable
print(item)




Show Original Post


04.01.2026 17:30
JavaScriptBuzz (@JavaScriptBuzz@mastodon.social)

Template Literals vs F-Strings: String Interpolation Showdown

JavaScript template literals vs Python f-strings. Which language's string formatting is more powerful? You won't believe this!

youtube.com/watch?v=OV6-CfV721g




Show Original Post


1 ...711 712 713 714 715 716 717 718 719 720 721 ...1582
UP