Introduction
- The 6 Best Python Courses on the Internet in 2023 β’ LearnDataSci π
- Introduction to the Python 3 Programming Language β’ Egghead π
- The Python Tutorial β’ Python docs π
- Learn Python by Building Five Games β’ freeCodeCamp πΊ
- Python Programming MOOC 2023 β’ Learn the basics of programming with the Python programming language. The focus of the course is on programming, and you will learn how to write programs and understand how they work. For example, the basics of algorithms, control structures, subprograms, object-oriented programming are covered. The course is suitable to anyone who wants to learn programming. No prior programming experience is required. β’ University of Helsinki π©βπ
- Invent with Python β’ Al Sweigart π
- Automate the Boring Stuff with Python β’ Al Sweigart π
- CS50βs Introduction to Programming with Python β’ Harvard University π©βπ
- futurecoder: learn python from scratch β’ 100% free and interactive Python course for beginners β’ Alex Hall π©βπ
- Python on Exercism β’ Get fluent in Python by solving 137 exercises β’ Exercism π©βπ
- A complete Beginnerβs Guide to Python by Making Simple Games β’ Al Sweigart πΊ
General
- dabeaz-course/python-mastery β’ Advanced Python mastery course
- Python and Pandas code snippets β’ InterviewQs π
- 5 Good Python Habits β’ check for
'__main__'
, give each module amain()
function, use list comprehensions β’ Indently πΊ - 5 Uncommon Python Features I Love β’ slice objects, set operations,
__format__
class method, walrus operator (:=
), currying β’ Indently πΊ
macOS setup
- Install
pyenv
brew install pyenv
+brew install pyenv-virtualenv
- confirm what I added in the end
- Install Python using
pyenv
- do not
brew install python
orbrew install python3
- confirm if itβs installed
- do not
- Set up VS Code
- Add Python extension to VS Code
- hopefully this doesnβt happen to you, but it did to me: if trouble with the Python extension (Python not added to the file language options list, python commands not working in integrated terminal):
- completely uninstall VS code (via AppCleaner + Homebrew uninstall +
rm -rf ~/.vscode
) - start a new VS install (via Homebrew) from scratch
- carefully add one extension and setting at a time + settings sync as you go after each change
- completely uninstall VS code (via AppCleaner + Homebrew uninstall +
Pyenv
- Version management for Python projects, similar to NVM for Node.js
- Managing Multiple Python Versions With pyenv β’ Real Python π
Functions
Positional vs Keyword Arguments
- The advantage of using keyword arguments is that the caller of the function can specify them in any order.
- The advantage of using positional arguments is that the caller of the function doesnβt need to know the names of the arguments.
- In general, itβs best to use keyword arguments for optional arguments and positional arguments for required arguments.
- Keyword (Named) Arguments in Python: How to Use Them β’ Trey Hunner π
- Positional vs Keyword Arguments in Python β’ GeeksforGeeks π
- Star (*) as a parameter in python function β’ Stack Overflow π
- python - How can we force naming of parameters when calling a function? β’ Stack Overflow π
- positional / named only without
*
or/
? (intermediate) anthony explains β’ Anthony Sottile πΊ
Closures
- A Pro Programmer Move (Closure in Python) β’ How to use a closure in Python to read and update a value β’ Pythonic Magic and Skill πΊ
Classes
- Why I prefer attrs over dataclasses β’ mCoding πΊ
Loops
- Quirky Python Loop Thing β’ Something interesting with Python array loopingβ¦
Performance
- Boost Python Code Performance with Caching: Exploring Techniques and Tools β’ How to dramatically speed up reruns of slow functions with
@functools.cache
and slow network requests withrequest_cache
β’ Pybites πΊ
Other Syntax
if __name__ = β__main__β
- means βif this app was run directly via a command like
python file.py
β
- means βif this app was run directly via a command like
- Test if all elements of a python list are False β’ StackOverflow π©βπ»
- Write a Python decorator from scratch to time the execution of a function β’ Pybites πΊ
Testing
- Pytest:
- Pytest β a beginnerβs guide β’ Lalitha π
- Pytest: Guide to Writing Effective Tests β’ Nadir Riyani π
- How do I print to console in pytest? β’ Stack Overflow π©βπ»
- unittest.mock:
- unittest.mock β mock object library β’ Python docs π
- The many flavors of mock.patch β’ Trey Hunner π
NumPy
- Complete Python NumPy Tutorial (Creating Arrays, Indexing, Math, Statistics, Reshaping) β’ Keith Galli πΊ
Flask
- Quickstart β’ Flask docs π
- Tutorial β’ Flask docs π
- How To Build & Deploy a React + Flask App | Towards Data Science β’ Reine π
- Learn Flask for Python β Full Tutorial β’ freeCodeCamp.org πΊ
- Full Stack Flask, React, and Postgres, pt. 1 β’ Chris DeSilva πΊ
Web Scraping
- Python Web Scraping with Beautiful Soup: Extracting Book Data β’ Quick walkthrough of how to use
BeautifulSoup
to parse a list of items on a webpage β’ Pybites πΊ - Scrape Twitter with 5 Lines of Code β’ Using
snscrape
to scrape social network data β’ Rob Mulla πΊ
CSV Parsing
- Csv Parsing - From List to Dict to (SimpleNamespace) Object β’ Pybites πΊ
- Using a bit of Python to get random emails from a csv file β’ Pybites πΊ
SQAlchemy
- Inbox:
- SQLAlchemy & Copilot Pt 1 - Defining Models β’ Visual Studio Code πΊ
- SQLAlchemy & Copilot Pt 2 - SQLite Databases β’ Visual Studio Code πΊ
- SQLAlchemy & Copilot Pt 3 - Running Queries β’ Visual Studio Code πΊ
Logging
- Modern Python logging β’ mCoding πΊ
Inbox
- Complete Python Mastery β’ Programming with Mosh π¨βπ
- python: python - Most pythonic way of assigning keyword arguments using a variable as keyword? - Stack Overflow - store kwargs to a function that takes keyword arguments as a dict, then unpack with function(**kwargs)
- python: ruff: Goodbye to Flake8 and PyLint: faster linting with Ruff
- python: ruff: Ruff: one Python linter to rule them all
- python: pytest: API Reference β pytest documentation - command line flag reference
- python: ruff: Ruff - linter and formatter that replaces Flake8, isort and Black
- pandas: intro: Getting started β pandas 2.1.3 documentation
- pandas: User Guide β pandas 2.1.3 documentation - guides that gradually build your pandas skills
- pandas: Series β pandas 2.1.3 documentation - series api references
- zen of python (add list of principles)
- pandas: how to use v3 + understand how it uses pyarrow as the default backend instead of numpy?
- course: Learn Backend Development the Fun Way | Boot.dev
- flask: API β Flask Documentation (3.0.x) - Flask v3 API
- flask: python - Get the data received in a Flask request - Stack Overflow - StackOverflow
- uv: Python packaging in Rust -
uv
is a faster alternative topip
andpip-tools
(from the creators ofruff
) - How to execute a file within the Python interpreter? - Stack Overflow - StackOverflow
- Common Gotchas β The Hitchhikerβs Guide to Python
- The Hitchhikerβs Guide to Python! β The Hitchhikerβs Guide to Python
- flask: API β Flask Documentation (3.0.x) - use
flask.request
to see the dataflask
parsed about the incoming request - Get Started β pytest documentation
- 1. Command line and environment β Python 3.12.2 documentation - Python docs
- Pythonβs assert: Debug and Test Your Code Like a Pro β Real Python - Real Python
- Modern Python logging - mCoding
- Flask contexts (And how to use them) | Moving rocks around - Diego Quintana
- threading β Thread-based parallelism β Python 3.12.3 documentation - Python docs
- multiprocessing β Process-based parallelism β Python 3.12.3 documentation - Python docs