This tutorial repo would be my journey of learning Python. I will add or update the repo as i learn more.
-
Download Python version >= 3.10 for osx or install using brew. It will install python in folder
/Library/Frameworks/Python.framework/Versions/3.10/bin
or/opt/homebrew/Cellar/python@3.10
-
Check if
python3
andpip3
can be called anywhere. pip3 is a package manager for python
If python 3 would be default python version, put it as shell alias for easier call. Below python or pip i write refer to alias version 3.
alias "python=/opt/homebrew/opt/python@3.10/bin/python3"
alias "pip=/opt/homebrew/opt/python@3.10/bin/pip3"
-
Install requirement packages used in this tutorial
pip install aiohttp more-itertools pytz
[TODO] put it inside
requirement.txt
-
Optional to enable python linting
pip install -U pylint
If you use VSCode, just open a python file and press play button on top right of vscode editor to run file in terminal.
Make sure to install Microsoft Python VSCode Extension first.
To run manually on terminal: python src/basic/file.py
src/basic
No | Name | Description |
---|---|---|
1 | Variables | Introduction to python comment, variable, print to console and var assignment |
2 | Type | How to use and create python data type |
3 | Function | Define and call function |
4 | Exception Handling | [TODO] How to handle error or exception |
5 | Class | OOP |
6 | Abstract Class | OOP - Contract interface |
7 | Generic Class | Using generic data type in class |
8 | Decorator | Extend function using Meta programming |
9 | Data Class | Enhance class with special decorator |
10 | Comprehension | Creating list based on based on existing list. For one liner lover :) |
11 | Functional Programming | Lambda, Closure, Map, Filter, Reduce |
12 | Date Time | Date and Time manipulation and formatting |
13 | Database | How to read and write from database |
14 | Iterator | Traversing oject values |
15 | Generator | Iterator in Lazy version |
16 | Asynchronous | Write concurrent code using asyncio |
17 | Async Http Request | Write asynchronous http request |
18 | Serialization JSON | Handle json data |
19 | Serialization Pickle | Serializing and de-serializing Python object structures |
20 | Multi Threading | Pararrel processing using Multi Threading (MT) and Multi Process (MP) |
21 | Regex | Regular Expression |
How to write unit testing in python
Practice solving leet code using python
No | Name | Description |
---|---|---|
1 | Two Sum Problem | Sum of two int element in a list match to the target int |
2 | Consecutive Chars | Count consecutive repeated chars from a string and return in a List of Dictionary |
3 | First Duplicate Number | Find value of duplicate number found in a list with shortest occurrance index |
4 | First Unique Char | Find first unique char in a string (non repeating char) |