pythonbase retweeted
"Give someone a program, you frustrate them for a day; teach them how to program, you frustrate them for a lifetime." - David Leinweber
pythonbase retweeted
#python tip: Make self-describing data by adding docstrings to named tuple attributes and to properties:
OMS_Burn = namedtuple('OMS_Burn', ('thrust', 'impulse'))
OMS_Burn.__doc__ = 'RCS MMH/N₂O₄'
OMS_Burn.thrust.__doc__ = 'kilonewtons'
OMS_Burn.impulse.__doc__ = 'milliseconds'
pythonbase retweeted
#Python cuteness: The walrus assignment expression operator and an f-string reverse walrus operator on the same line:
for angle in range(360):
print(f'{angle=}\N{degree sign} {(theta:=radians(angle))=:.3f} {sin(theta)=:.3f}')
pythonbase retweeted
As a #python 3.8 learning exercise, I'm using the walrus operator, / notation, and f= at every opportunity and then evaluating the result for clarity.
The goal is to learn when the new features are better and when they are worse. On Twitter, I'm presenting them without judgment.
pythonbase retweeted
Have 100+ books (mostly non-fiction) that I need to dispose of urgently in order to make space for new purchases. Selling as low as Rs 300 /book. Huge discount if someone can take all of them. Plz RT
I am in Karachi.
pythonbase retweeted
#pytest 5.0 has been released! This is the first release which is **Python 3 Only** -- the release also contains a bunch of new features and fixes. Check out the full changelog: docs.pytest.org/en/latest/ch…
pythonbase retweeted
Since Yahoo Finance API is deprecated, there are limited options to grab their data. If you're doing it in Python, go for yfinance package by @Aroussi, pulls data in pandas frame. Fun to work with. 👍
github.com/ranaroussi/yfinan…
teapaw.org/kashaziz/status/114463…
pythonbase retweeted
🐍📰 Python REST APIs With Flask, Connexion, and SQLAlchemy – Part 3 — realpython.com/flask-connexi…
pythonbase retweeted
Are you a novice Python user, and want to help the community?
Nicole is specifically looking for people with little or no experience with security and 2FA to provide feedback. If that’s you, please sign up for a session - you can help make PyPI better for everyone!
🐍📦✨
Searching for #python people to user test the latest security features deployed to @pypi
Do you have a PyPI account?
Do you have 30 minutes to speak with me?
I'd love to find out if the new interfaces work for you :)
Please signup here: calendly.com/nlhkabu/pypi
🐍📦✨
pythonbase retweeted
#python tip: itertools.repeat() is faster than range() for looping a fixed number of times when you don't need the loop variable.
min(random() for i in range(10_000)) # 1.03 msec per loop
min(random() for _ in repeat(None, 10_000)) # 841 usec per loop











