pythonbase (@pythonbase) header
pythonbase (@pythonbase) profile picture

Python Base covers Python news, resources and Python code snippets.

Joined April 2019
If you are into #Python and want to learn more about the language especially how to automate stuff, @AlSweigart is your guy. Get 'Automate the Boring Stuff with Python' Udemy course for free 👇 nitter.cf/AlSweigar…
The built-in logging mechanism in #Python is amazing. Generating file based logs and using tail -f (on linux / mac) is a fun away to interact with, and debug, an application / script.
Sunsetting #Python 2 - The official sunset date is released. buff.ly/2LBaJ1K
Wondering if any GH type games have been made in python? buff.ly/2yhnat9
How to intermix dataframes in pandas? buff.ly/2Yo9asd
Goodforbitcoin, a Python cryptocurrency market tracker buff.ly/2Mvz4bx
Efficient way of parsing a string in Python buff.ly/2YtxoBj
1
1
"Give someone a program, you frustrate them for a day; teach them how to program, you frustrate them for a lifetime." - David Leinweber
12
359
25
1,312
Bankruptcy Prediction with Python buff.ly/2YmgSYa
Episode #140 Becoming a 10x Developer (sorta) via @pythonbytes buff.ly/2YaKsM1
#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'
5
50
3
213
#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}')
24
37
10
161
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.
5
23
2
163
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.
3
8
2
#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…
1
76
5
159
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… nitter.cf/kashaziz/status/114463…
Working on #Python #Flask web service to provide stock related info. 1. Input: Stock symbol, say MSFT via URL end point 2. Data fetched from Yahoo Finance and other sources 3. Excel document generated with company info, financials, stock history 4. Output: base64 encoded JSON
1
3
4
🐍📰 Python REST APIs With Flask, Connexion, and SQLAlchemy – Part 3 — realpython.com/flask-connexi…
16
52
how I got better at debugging
136
3,199
266
10,695