#pythonic
Hey #Python folks (and I'm looking especially at you @treyhunner) what's the most #pythonic way to “write to file if it exists, else create it and then write to it”?
`open(filename, ‘x’)` only works once, AIUI. I want a code snippet (or library!) that will work every time
Deconstructing xkcd.com/1987 by @brettcannon https://snarky.ca/deconstructing-xkcd-com-1987/ #pythonic
While working with #Python, I miss being able to use an assignment statement as an expression, particularly when constructing a while loop.
Example:
while ((myDate = NextFOM (myDate)) <= EndDate):
print ("First of Month", myDate)
From what I've read, it looks like a #Pythonic way to rewrite the above code looks like this:
while True:
myDate = NextFOM (myDate)
if myDate > EndDate:
break
print ("First of Month", myDate)
My book "Pythonic Programming" is featured and on special sale today (12/20/2022) from 6PM to 11PM EST at https://pragprog.com/titles/dzpythonic #12DaysOfPragProg #python #pythonic #programming #dzpythonic
OK, fellow #Python devs. I’ve donned my asbestos suit and am ready to open the door to the inferno. 😆 I’m writing a piece for my students (elementary Python class) on writing “Pythonic" code, which might expand into a blog entry at some point. So, with that in mind...
What are some common things that tell you a piece of code is Pythonic?
Could be stylistic, could be functional, anything's good. I'm just looking for tell-tale signs of #Pythonic code vs. code written with an “accent" from another language. (A couple I’ve already scribbled down: list comprehensions, lambda over map/filter…)
⚠️ New #PYTHON #MALWARE package detected by
phylum.io
just published to #pypi. Drops malware to developer machines.
VirusTotal
https://virustotal.com/gui/file/33df1d9c50a9bd9d3e71dc61c0a7f41f7ca51612e9c3babcea927adde169e62d
PyPI Page
https://pypi.org/project/shaders/
@bbbhltz yep.. bet all these people gonna be crying when they eventually hammer in the nails in the coffin for #OpenWebStandards, after flocking to #chrome for that tiny shred of convenience.
You can watch live right now what happens when a few people (well, one, in the current example) get to decide for everybody what's best for them 🐦
@mozilla <3
Or to put it in #pythonic words.. it shouldn't be the lady in the lake deciding.
https://youtu.be/m15MNLtpYUE
« Use your #RaspberryPi as a #DataLogger : Here's how to log the CPU temperature of a Raspberry Pi and create a spreadsheet-based report on demand » using #Pythonic and thus #Python > https://opensource.com/article/22/3/raspberry-pi-data-logger
The video of the talk "Maps with GeoDjango, PostGIS and Leaflet" 🗺️ I presented at #DjangoConEurope 2019 🇪🇺 in Copenhagen 🇩🇰 has almost reached 15000 views. 🚀
I'm very happy and also surprised at the same time.
See you at the next #pythonic conference. 🐍
https://www.youtube.com/watch?v=aEivCtavw-I
RT @raymondh@twitter.com
Better practices aren't imposed, they are discovered.
We have to collectively decide what is the #Pythonic way to use or not use the new tooling.
Das grafische Programmierwerkzeug Pythonic
Das grafische Programmiertool Pythonic erlaubt den Anwender mit Hilfe von Funktionsbausteinen, Python-Anwendungen auf einfachen Wege zu erstellen. Die auf PyQt5 aufsetzende Anwendung richtet sich vor allem an Programmier-Neulinge.
#Programmierwerkzeug #Pythonic #Programmiertool #Funktionsbausteinen #Python #PyQt5 #Programmierer #Neulinge #Programmierung #Softwareentwicklung #PythonCode
https://www.pro-linux.de/artikel/2/1972/das-grafische-programmierwerkzeug-pythonic.html