cark, to python German
@cark@social.tchncs.de avatar

Wdh, für alle, die den Post am Montag Vormittag verpasst haben:

Hallo :python: interessierte Menschen.

@piko und ich betreuen im September zusammen die

Online Summerschool Python für Ingenieurinnen

Dafür haben wir ein Quiz gebaut, mit dem die TN ihre :python: Grundkenntnisse testen können:

https://codequiz.org/quiz/test/46/

Wir würden uns über Feedback zu diesem Quiz aus der :mastodon: :python: Bubble riesig freuen 😊

PS: Das (sehr gute!) Montags-Feedback ist schon eingearbeitet.

carlton, to python
@carlton@fosstodon.org avatar

Seems relevant today… my controversial maintainer's opinion is that dropping support for EOL versions does not count as a breaking change.

forteller, to python
@forteller@tutoteket.no avatar

Could someone please give me the simplest possible step-by-step on how to run a python script on Windows?

Is it just installing Windows installer (64-bit) from https://www.python.org/downloads/windows/ and then double clicking the .py file? Or is there some other steps?

mkennedy, to python
@mkennedy@fosstodon.org avatar

Looking for some (email) advice:

I’ve been using Mailchimp forever but their prices seem to go up by $100 every other month these days and I’m not really using many of their features. Yet our web apps are pretty tied in with their APIs so changing is non trivial.

Anyone have a recommendation of an excellent alternative with personalized campaign features (e.g. convert kit)?

people

mike, to python
@mike@fosstodon.org avatar

I'm a garbage programmer, and even I can pull this off.

import requests, json, re

def strip_html(text):
pattern = re.compile(r"<.*?>", re.DOTALL)
return pattern.sub("", text)

i = "https://fosstodon.org/api/v1/timelines/public"
m = requests.get(i)
d = json.loads(m.content)

for x in d:
dat = x["account"]
txt = x["content"]
print (dat["display_name"] + " (" + dat["acct"] + "):")
print (strip_html(txt))
print("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")

Crell, to rust
@Crell@phpc.social avatar

This video is about , but it's comments about error handling are valid for anyone in any language. PHP friends especially, this is the kind of stuff I've been ranting about for a while now. :-)

https://youtu.be/sbVxq7nNtgo

treyhunner, to python
@treyhunner@mastodon.social avatar

I wish 's string replace method allowed specifying "count" as a keyword argument.

>>> text = "Hello? Python?"
>>> text.replace("?", "!", count=1)

I find that more explicit than this:

>>> text.replace("?", "!", 1)
'Hello! Python?'

But the replace only allows positional arguments 🐍😢

SnoopJ, to python
@SnoopJ@hachyderm.io avatar

Managed to build the and get it running in wasmtime via the API, thanks to @brettcannon's build script and documentation 👀

kevinbowen, to python
@kevinbowen@fosstodon.org avatar

Ending up going down a silly, little rat-hole today setting up a project to play with

Seems like py5 won't play nice with It does, however, work fine with poetry. 🤔

I had been taking pdm for a test drive this month; but, at least for some graphics tinkering I will use poetry for dependency management. Unless I can figure out what the bug is between py5 & pdm. Yay!

EducatedSavage, to music

I'm just gonna shout into the void and see how it goes here.

I just learned my 3rd chord on guitar on round 2 of attempting to learn (long story) but also play piano (mediocre), tin whistle (newb), darbuka (newb) and dance (ex pro). Currently studying flamenco, ra'i, and jazz, in my own way (not the only stuff I listen to).

Also putting together my first real project for work instead of just fixing other peoples'. It's chaos, bc this is the way.

fohrloop, to til
@fohrloop@fosstodon.org avatar

when creating a python project, and using some==2.2.0 to "pin" your requirements isn't actually pinning them, as the package owner (or anyone with access) may upload version 2.2.0-1, 2.2.0-2, etc. which will match the "==2.2.0".

https://www.youtube.com/watch?v=oGpyupM52IQ

publicvoit, to NixOS
@publicvoit@graz.social avatar

Yet another fail on my ground:

Had to invest hours of debugging only to find out that in the end, my interpreter can't find the installed zlib of the system. This way, could not be imported because of that. 😔

Another taske of: "Never ever use NixOS when you plan to execute Python scripts."

I'll need to summarize my issue and nag the community in order to find out the underlying reason. 😜

glyph, to python
@glyph@mastodon.social avatar

Here's a puzzle:

Let's say we have a bunch of different kinds of object that exist in some long-lived context, like a server-side physics sim or a GUI. They have attributes. We want to model them as such, not stringly-typed config, because they're data structures with types & behavior.

How to implement generic change notifications without inheriting an implementation of setattr or something morally equivalent?

This is the final frontier of composition-over-inheritance for me.

#python

walkerb, to programming

I was surprised to find out yesterday that has no SWITCH...CASE construct.

Since I consider IF...ELSEIF trees butt ugly, even though they produce the same result. I went looking for another way.

It can be emulated pretty well by using a dictionary lookup instead.

vwbusguy, to python
@vwbusguy@mastodon.online avatar

Want to print a random codepoint in a shell for some reason? to the rescue!

python -c 'import random; print(chr(random.choice(range(0,int(0x10FFFF + 1)))))'

fell, (edited ) to programming
@fell@ma.fellr.net avatar
glyph, to python
@glyph@mastodon.social avatar

And while I'm on the topic of new versions, here's a blog post that has been brewing for a really long time, covering a whole slew of kinda-but-not-really relevant details about which Python you should use and why, on macOS at least: https://blog.glyph.im/2023/08/get-your-mac-python-from-python-dot-org.html

nedbat, to python
@nedbat@hachyderm.io avatar

Opinions? Should this produce a syntax warning?

if x == 2 or 3:

https://discuss.python.org/t/can-we-make-a-syntaxwarning-for-if-x-2-or-3/30263

Jdreben, to javascript

I regularly use and love #Typescript. I used to use #Python the most – it’s what I learned in and I am more interested in backends than frontends. I also am regularly using and really enjoying #Kotlin (so much better than #Java). But truly Typescript is bae.

#Julia is a joy to work with. Very much like Python but more powerful. If it had the library support Python or #JVM has I would probably prefer to use Julia for backends.

But Typescript really changed the game and now that’s probably my favorite language not just because of the language itself but because it has web dominance. Until I can write #WASM with Python or Kotlin or Rust, and I’m building #web applications, TS is my lingua franca.

I want to try #Rust because it’s the new hotness.

veronica, to programming
@veronica@mastodon.online avatar

I'm experimenting with a new Preferences dialog for my app. These are never easy to make and are usually hard to navigate due to the volume of labels and buttons.

I'm testing out putting all the setting on a long page with navigation buttons. This replaces the traditional tabbed layout the app currently uses.

It is still an information overload. Maybe I can also make the content searchable?

A short video of a Preferences dialog in a writing application. All settings are in a long, scrollable list on the right, with a series of navigation buttons on the left that takes you to each category of settings when they are clicked.

andrewfeeney, (edited ) to php
@andrewfeeney@phpc.social avatar

Folks, if you parrot opinions like "PHP is an insecure language" or "PHP has inherent security flaws" in 2024, and you can't point to specific issues with modern, current versions of PHP to back it up, all you are doing is demonstrating your ignorance.

The fact is, modern is every bit as secure, solid and performant a server-side platform as , , or many other popular languages.

rimu, to python
@rimu@mastodon.nzoss.nz avatar

It took 4 months and 50 code commits, but my federated version of reddit (written in ) can now follow and be followed by instances of and !

Getting working has been ... a journey.

Screenshot of a federated reddit clone

keithzg, to python
@keithzg@fediverse.keithzg.ca avatar

Was just thinking to myself that while language-specific package managers are a crime against God, at least ‘s pip is half-decent compared to others, but then I ran into a reason to use it and immediately:

RuntimeError: PyPI no longer supports ‘pip search’ (or XML-RPC search). Please use https://pypi.org/search (via a browser) instead.

and then eventually I got to the point where instead I was getting compile errors on the package in question somehow, and now I’m downgrading pip to “as much of an affront to nature as all the other language-specific package managers”. (Probably not even for the first time, I just forget in the meanwhile.)

vwbusguy, to programming
@vwbusguy@mastodon.online avatar

Using for a project since the SDK has really nice structs and instantiators for all the API calls where the SDK for the project just phoned it in for all the payloads.

gregorni, to ProgrammingLanguages
@gregorni@fosstodon.org avatar

Is there a compiled programming language with a Python-like syntax?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines