{"id":20619675,"url":"https://github.com/twtrubiks/python-notes","last_synced_at":"2025-04-22T04:35:47.738Z","repository":{"id":20470824,"uuid":"90001387","full_name":"twtrubiks/python-notes","owner":"twtrubiks","description":"Python Study Notes 📝","archived":false,"fork":false,"pushed_at":"2025-04-19T06:38:45.000Z","size":331,"stargazers_count":102,"open_issues_count":0,"forks_count":50,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-20T19:16:28.192Z","etag":null,"topics":["notes","python","python-patterns","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twtrubiks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-05-02T06:55:21.000Z","updated_at":"2025-04-19T06:38:48.000Z","dependencies_parsed_at":"2023-09-24T06:26:59.230Z","dependency_job_id":"13622849-d7c0-4977-a4c8-f142d0ed240f","html_url":"https://github.com/twtrubiks/python-notes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twtrubiks%2Fpython-notes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twtrubiks%2Fpython-notes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twtrubiks%2Fpython-notes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twtrubiks%2Fpython-notes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twtrubiks","download_url":"https://codeload.github.com/twtrubiks/python-notes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250171540,"owners_count":21386788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["notes","python","python-patterns","tutorial"],"created_at":"2024-11-16T12:12:15.835Z","updated_at":"2025-04-22T04:35:47.702Z","avatar_url":"https://github.com/twtrubiks.png","language":"Python","readme":"# python-notes\n\nPython Notes 學習筆記 📝\n\n## 介紹\n\n有時候想找一個東西（寫法），但當下卻忘記關鍵字，所以整理一篇學習筆記，要找資料的時候也比較方便。\n\n有些是網路上找的範例，然後自己再修修改改，或是去參考一些  Python-Patterns , Python Anti-Patterns 。\n\n範例程式會盡量遵守 [PEP 8 -- Style Guide for Python Code](https://www.python.org/dev/peps/pep-0008/)\n\n歡迎大家一起討論～\n\n筆記會持續更新～\n\n## 筆記\n\n[global_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/global_tutorial.py) - global tutorial\n\n[globals_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/globals_tutorial.py) - globals tutorial\n\n[repr_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/repr_tutorial.py) - repr tutorial\n\n[assert_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/assert_tutorial.py) - assert tutorial\n\n[str_find_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/str_find_tutorial.py) - str_find tutorial\n\n[rjust_ljust_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/rjust_ljust_tutorial.py) - str rjust ljust tutorial\n\n[attribute_obj.py](https://github.com/twtrubiks/python-notes/blob/master/attribute_obj.py) - setattr() , getattr() , hasattr()\n\n[check_is_in_list.py](https://github.com/twtrubiks/python-notes/blob/master/check_is_in_list.py) -  檢查目標是否在 list 裡\n\n[datetime_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/datetime_tutorial.py) - datetime , monthrange , timestamp\n\n[defaultdict_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/defaultdict_tutorial.py) - defaultdict\n\n[counter_tutorial.py](counter_tutorial.py) - counter\n\n[namedtuple_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/namedtuple_tutorial.py) - namedtuple\n\n[dictionary_using_items.py](https://github.com/twtrubiks/python-notes/blob/master/dictionary_using_items.py) - dictionary.items()\n\n[dictionary_get.py](https://github.com/twtrubiks/python-notes/blob/master/dictionary_get.py) - dictionary get()\n\n[set_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/set_tutorial.py) - set tutorial\n\n[dictionary_update.py](https://github.com/twtrubiks/python-notes/blob/master/dictionary_update.py) - dictionary update()\n\n[tuple_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/tuple_tutorial.py) - tuple\n\n[eafp.py](https://github.com/twtrubiks/python-notes/blob/master/eafp.py) - EAFP coding style\n\n[enumerate_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/enumerate_tutorial.py) - enumerate\n\n[filter.py](https://github.com/twtrubiks/python-notes/blob/master/filter.py) - filter\n\n[format.py](https://github.com/twtrubiks/python-notes/blob/master/format.py) - format\n\n[function_default.py](https://github.com/twtrubiks/python-notes/blob/master/function_default.py) -  function default value\n\n[isdigit.py](https://github.com/twtrubiks/python-notes/blob/master/isdigit.py) - isdigit()\n\n[isinstance.py](https://github.com/twtrubiks/python-notes/blob/master/isinstance.py) - check type\n\n[join.py](https://github.com/twtrubiks/python-notes/blob/master/join.py) - join\n\n[json_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/json_tutorial.py) - json.loads()\n\n[convert_class_object_to_json.py](https://github.com/twtrubiks/python-notes/blob/master/convert_class_object_to_json.py)\n\n[convert_json_to_class_object.py](https://github.com/twtrubiks/python-notes/blob/master/convert_json_to_class_object.py)\n\n[kwargs.py](https://github.com/twtrubiks/python-notes/blob/master/kwargs.py) - **kwargs , *arg - [youtube tutorial - What is **kwargs  *args](https://youtu.be/UwhbFxLADmE)\n\n[lambda.py](https://github.com/twtrubiks/python-notes/blob/master/lambda.py) - lambda\n\n[list_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/list_tutorial.py) - list tutorial\n\n[loop_if_else_break.py](https://github.com/twtrubiks/python-notes/blob/master/loop_if_else_break.py) - if not add break , will run more meaningless loop\n\n[map_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/map_tutorial.py) - map tutorial\n\n[OrderedDict_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/OrderedDict_tutorial.py) - OrderedDict\n\n[MappingProxyType_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/MappingProxyType_tutorial.py) - MappingProxyType\n\n[parse_dateutil.py](https://github.com/twtrubiks/python-notes/blob/master/parse_dateutil.py) - dateutil.parser\n\n[property_decorator.py](https://github.com/twtrubiks/python-notes/blob/master/property_decorator.py) - property_decorator\n\n[raise_an_exception_from_function_call.py](https://github.com/twtrubiks/python-notes/blob/master/raise_an_exception_from_function_call.py) - it is better to raise an exception that can be caught by the caller instead.\n\n[range.py](https://github.com/twtrubiks/python-notes/blob/master/range.py) -  range\n\n[reduce.py](https://github.com/twtrubiks/python-notes/blob/master/reduce.py) - reduce\n\n[setdefault_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/setdefault_tutorial.py) - setdefault\n\n[sort.py](https://github.com/twtrubiks/python-notes/blob/master/sort.py) - sort\n\n[sorted.py](https://github.com/twtrubiks/python-notes/blob/master/sorted.py) - sorted\n\n[iter_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/iter_tutorial.py) - iter tutorial\n\n[iter_another_trick_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/iter_another_trick_tutorial.py) - iter another trick tutorial\n\n[iterator_in_tutorial](https://github.com/twtrubiks/python-notes/blob/master/iterator_in_tutorial.md) - in 也會消費 iterator\n\n[__iter__tutorial](https://github.com/twtrubiks/python-notes/blob/master/__iter__tutorial.py) - `__iter__` tutorial\n\n[yield_tutorial.py](yield_tutorial.py)- yield tutorial\n\n[yield_from_tutorial.py](yield_from_tutorial.py)- yield from tutorial\n\n[Enum_tutorial.py](Enum_tutorial.py)- Enum tutorial\n\n[strtobool_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/strtobool_tutorial.py) - strtobool\n\n[underscore_variable.py](https://github.com/twtrubiks/python-notes/blob/master/underscore_variable.py) -  underscore variable\n\n[use_unpacking.py](https://github.com/twtrubiks/python-notes/blob/master/use_unpacking.py) - use unpacking\n\n[using_a_mutable_default_value_as_an_argument.py](https://github.com/twtrubiks/python-notes/blob/master/using_a_mutable_default_value_as_an_argument.py) -  Be careful with mutable default arguments ( lists or dictionaries ) - [youtube tutorial](https://youtu.be/H5S0e_lNOlo)\n\n[zip_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/zip_tutorial.py) - zip\n\n[staticmethod_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/staticmethod_tutorial.py) - staticmethod tutorial\n\n[classmethod_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/classmethod_tutorial.py) - classmethod tutorial\n\n[decorator_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/decorator_tutorial.py) - decorator 裝飾器\n\n[decorator_inspect.py](https://github.com/twtrubiks/python-notes/blob/master/decorator_inspect.py) - decorator inspect tutorial\n\n[with_as_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/with_as_tutorial.py) - with as tutorial\n\n[context_manager_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/context_manager_tutorial.py) - context manager\n\n[suppress_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/suppress_tutorial.py) - context manager - suppress - [youtube tutorial - python 教學 - 什麼是 suppress](https://youtu.be/t4FbMd4n4rE)\n\n[configparser_tutorial](https://github.com/twtrubiks/python-notes/blob/master/configparser_tutorial) - ConfigParser tutorial，可參考 [https://docs.python.org/3/library/configparser.html](https://docs.python.org/3/library/configparser.html)\n\n[decimal_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/decimal_tutorial.py) - decimal tutorial\n\n[copy_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/copy_tutorial.py) - copy_tutorial\n\n[sum_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/sum_tutorial.py) - sum_tutorial\n\n[math_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/math_tutorial.py) - math_tutorial\n\n[built-in-functions_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/built-in-functions_tutorial.py) - Built-in Functions tutorial\n\n[division_operators_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/division_operators_tutorial.py) - division operators tutorial\n\n[reduce_use_for_loop_tutorial_1.py](https://github.com/twtrubiks/python-notes/blob/master/reduce_use_for_loop_tutorial_1.py) - reduce_use_for_loop_tutorial_1\n\n[reduce_use_for_loop_tutorial_2.py](https://github.com/twtrubiks/python-notes/blob/master/reduce_use_for_loop_tutorial_2.py) -        reduce_use_for_loop_tutorial_2\n\n[nested_loop_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/nested_loop_tutorial.py) - nested_loop_tutorial\n\n[dict.fromkeys_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/dict.fromkeys_tutorial.py) - dict.fromkeys tutorial\n\n[escape_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/escape_tutorial.py) - html.parser ( escape )  tutorial\n\n[urllib_parse_quote_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/urllib_parse_quote_tutorial.py) - urllib.parse quote tutorial\n\n[pickle_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/pickle_tutorial.py) - pickle tutorial\n\n[__reduce__tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/__reduce__tutorial.py) - `__reduce__` tutorial\n\n[zipfile_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/zipfile_tutorial.py) - zipfile tutorial\n\n[unicodedata_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/unicodedata_tutorial.py) - unicodedata ( control character ) tutorial\n\n[translate_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/translate_tutorial.py) - translate tutorial\n\n[re_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/re_tutorial.py) - re tutorial\n\n[fnmatch_tutorial](https://github.com/twtrubiks/python-notes/blob/master/fnmatch_tutorial) - fnmatch tutorial\n\n[is_integer_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/is_integer_tutorial.py) - float is_integer tutorial  ( TestCase )\n\n[remove_trailing_zeros_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/remove_trailing_zeros_tutorial.py) - decimal remove trailing zeros tutorial ( TestCase )\n\n[itemgetter_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/itemgetter_tutorial.py) - itemgetter tutorial\n\n[groupby_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/groupby_tutorial.py) - itertools groupby tutorial\n\n[groupby_tutorial_find_consecutive numbers.py](https://github.com/twtrubiks/python-notes/blob/master/groupby_tutorial_find_consecutive_numbers.py) - find consecutive numbers in list by groupby tutorial\n\n[python-decouple-tutorial](https://github.com/twtrubiks/python-notes/tree/master/python-decouple-tutorial) - python decouple tutorial\n\n[dj_database_url_tutorial](https://github.com/twtrubiks/python-notes/tree/master/dj_database_url_tutorial) - dj-database-url tutorial ( for django )\n\n[pandas_tutorial](https://github.com/twtrubiks/python-notes/tree/master/pandas_tutorial) - pandas tutorial\n\n[random_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/random_tutorial.py) - random tutorial\n\n[__str__tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/__str__tutorial.py) - `__str__`  tutorial\n\n[__len__tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/__len__tutorial.py) - `__len__` tutorial\n\n[__call__tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/__call__tutorial.py) - `__call__` tutorial - [youtube tutorial - What is the `__call__` in python](https://youtu.be/YIstPYG15IA)\n\n[__getattr__tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/__getattr__tutorial.py) - `__getattr__` and `__getattribute__` tutorial\n\n[__getitem__tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/__getitem__tutorial.py) - `__getitem__` and `__setitem__` tutorial\n\n[__new__tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/__new__tutorial.py) - `__new__` tutorial\n\n`__get__tutorial.py` - 參考 [what_is_the_Descriptor](https://github.com/twtrubiks/fluent-python-notes/tree/master/what_is_the_Descriptor)\n\n[queue_tutorial.py](queue_tutorial.py) - queue tutorial\n\n[methodcaller_tutorial](methodcaller_tutorial) - methodcaller tutorial - [youtube tutorial - python 教學 - 什麼是 methodcaller](https://youtu.be/OEMPp9i1kYc)\n\n[str_startswith_tutorial.py](str_startswith_tutorial.py) - str.startswith() tutorial\n\n[logging_tutorial.py](logging_tutorial.py) - logging tutorial\n\n[operator_or_xor_tutorial.py](operator_or_xor_tutorial.py) - or xor tutorial\n\n[operator_add_tutorial.py](operator_add_tutorial.py) - operator.add tutorial\n\n[operator_mul_tutorial.py](operator_mul_tutorial.py) - operator.mul tutorial\n\n[itertools_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/itertools_tutorial.py) - itertools tutorial\n\n[itertools_islice_tutorial.py](itertools_islice_tutorial.py) - itertools.islice tutorial\n\n[itertools_tee_tutorial.py](itertools_tee_tutorial.py) - itertools.tee tutorial\n\n[base64_tutorial.py](base64_tutorial.py) - base64 encode decode tutorial\n\n[bytesio_tutorial.py](bytesio_tutorial.py) - bytesio tutorial\n\n[stringio_tutorial.py](stringio_tutorial.py) - stringio tutorial\n\n[string_constants_tutorial.py](string_constants_tutorial.py) - string constants tutorial\n\n[functools_partial_tutorial.py](functools_partial_tutorial.py) - functools.partial tutorial\n\n[try_except_tutorial.py](try_except_tutorial.py) - try except tutorial\n\n[try_finally_tutorial.py](try_finally_tutorial.py) - try except finally tutorial\n\n[user_defined_exceptions_tutorial.py](user_defined_exceptions_tutorial.py) - User-defined Exceptions tutorial\n\n[weakref_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/weakref_tutorial.py) - weakref tutorial\n\n[hashlib_tutorial](https://github.com/twtrubiks/python-notes/blob/master/hashlib_tutorial) - hashlib (MD5 SHA-1 簽名) tutorial\n\n[bcrypt_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/bcrypt_tutorial.py) - bcrypt hash salt tutorial\n\n[hmac_sha256_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/hmac_sha256_tutorial.py) - hmac sha256 tutorial\n\n[pycryptodome_tutorial](https://github.com/twtrubiks/python-notes/blob/master/pycryptodome_tutorial) - pycryptodome 完成 RSA 簽名驗簽, RSA 加解密\n\n[aes_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/pycryptodome_tutorial/aes_tutorial.py) - pycryptodome 完成 AES CBC 加解密\n\n[pyjwt_tutorial](https://github.com/twtrubiks/python-notes/blob/master/pyjwt_tutorial.py) - jwt 教學\n\n[pyotp](pyotp_tutorial.md) - 實作 two-factor (2FA) or multi-factor (MFA)\n\n[assignment_expressions_tutorial](assignment_expressions_tutorial.md) - [Youtube Tutorial - 海象運算符 PEP 572 – Assignment Expressions - python3](https://youtu.be/X_1o8e-DjH0)\n\n[match_case_tutorial.py](match_case_tutorial.py) - match case statement was introduced in Python 3.10\n\n[dataclasses_tutorial.py](https://github.com/twtrubiks/python-notes/blob/master/dataclasses_tutorial.py) - dataclasses tutorial\n\n[importlib_tutorial](https://github.com/twtrubiks/python-notes/blob/master/importlib_tutorial) - 動態 import lib\n\n[mock_tutorial](https://github.com/twtrubiks/python-notes/blob/master/mock_tutorial) - mock 教學\n\n[redis_tutorial](https://github.com/twtrubiks/python-notes/tree/master/redis_tutorial) - redis 教學\n\n[pika_tutorial](https://github.com/twtrubiks/python-notes/tree/master/pika_tutorial) - pika for Rabbitmq 教學\n\n[thread_process_tutorial](https://github.com/twtrubiks/python-notes/tree/master/thread_process_tutorial) - thread, process 教學\n\n[concurrent_futures_tutorial](https://github.com/twtrubiks/python-notes/tree/master/concurrent_futures_tutorial) - concurrent futures 教學\n\n[asyico_tutorial](https://github.com/twtrubiks/python-notes/tree/master/asyico_tutorial) - asyico 教學\n\n[aiohttp_tutorial](https://github.com/twtrubiks/python-notes/tree/master/aiohttp_tutorial) - aiohttp 教學\n\n[pathlib_tutorial.py](https://github.com/twtrubiks/python-notes/tree/master/pathlib_tutorial.py) - pathlib 教學\n\n[colorama_tutorial.py](https://github.com/twtrubiks/python-notes/tree/master/colorama_tutorial.py) - 讓 python 輸出 terminal 有顏色\n\n[cachetools_tutorial.py](https://github.com/twtrubiks/python-notes/tree/master/cachetools_tutorial.py) - cachetools 教學\n\n## 觀念\n\n[python_circular_import](https://github.com/twtrubiks/python-notes/tree/master/python_circular_import) - [youtube tutorial - What is Python Circular Imports](https://youtu.be/RQhN24QtDAE)\n\n[What happens when you type an URL in the browser and press enter](https://github.com/twtrubiks/python-notes/tree/master/what_happens_when_you_type_an_URL_in_the_browser_and_press_enter) - [youtube tutorial - What happens when you type an URL in the browser and press enter](https://youtu.be/PDR-fIooaLE)\n\n[cap theorem](https://github.com/twtrubiks/python-notes/tree/master/cap_theorem) - [youtube tutorial - What is CAP theorem](https://youtu.be/jBgN5g_FaOs)\n\n[what is the python decorator](https://github.com/twtrubiks/python-notes/tree/master/what_is_the_python_decorator)\n\n[what is the python property](https://github.com/twtrubiks/python-notes/tree/master/what_is_the_property)\n\n[what is the classmethod and staticmethod](https://github.com/twtrubiks/python-notes/tree/master/what_is_classmethod_and_staticmethod)\n\n[what is the abstractmethod](https://github.com/twtrubiks/python-notes/tree/master/what_is_the_abstractmethod)\n\n[what is the functools.lru_cache](https://github.com/twtrubiks/python-notes/tree/master/what_is_the_functools.lru_cache)\n\n[what is the singledispatch](https://github.com/twtrubiks/python-notes/tree/master/what_is_the_singledispatch)\n\n[what is the singledispatchmethod](https://github.com/twtrubiks/python-notes/tree/master/what_is_the_singledispatchmethod)\n\n[what is the `if __name__ == '__main__'` in python](https://github.com/twtrubiks/python-notes/tree/master/what_is_the_name_main_in_python)\n\n[what is private and protected attribute](https://github.com/twtrubiks/python-notes/tree/master/what_is_private_and_protected_attribute)\n\n[what is the python interpreter](https://github.com/twtrubiks/python-notes/blob/master/interpreter)\n\n[what is the f-string](https://github.com/twtrubiks/python-notes/tree/master/what_is_f-string)\n\n[what is the mixin](https://github.com/twtrubiks/python-notes/tree/master/what_is_the_mixin)\n\n[type-hints-tutorial](https://github.com/twtrubiks/python-notes/tree/master/type-hints-tutorial) - PEP 484 Type Hints 介紹 - [youtube tutorial - PEP 484 Type Hints 介紹](https://youtu.be/kXB__qIz5gY)\n\n[pydantic_tutorial](pydantic_tutorial) - pydantic 介紹\n\n## other\n\n[fibonacci numbers tutorial](fibonacci_numbers_tutorial)\n\n## data structure\n\n[linked list](https://github.com/twtrubiks/python-notes/tree/master/data_structure/linked_list/Introduction)\n\n[binary_tree_traversal](https://github.com/twtrubiks/python-notes/tree/master/binary_tree_traversal)\n\n[graph](https://github.com/twtrubiks/python-notes/tree/master/graph)\n\n\n## tools\n\n[vcr-tutorial](vcr-tutorial) - [Youtube Tutorial - vcrpy 介紹教學 - 輕鬆把 request 錄下來](https://youtu.be/LrAxl5vfXJ4)\n\n[freezegun_tutorial.py](freezegun_tutorial.py) - mock datetime\n\n[faker_tutorial.py](https://github.com/twtrubiks/python-notes/tree/master/faker_tutorial.py) - 產生假資料\n\n[decorator_lib.py](decorator_lib.py) - decorator lib tutorial\n\n[pytest_tutorial](pytest_tutorial) - pytest 教學\n\n[flake8](https://github.com/PyCQA/flake8) - linter 工具\n\n[black](https://github.com/psf/black) - 自動排版工具\n\n[isort](https://github.com/PyCQA/isort) - 排序 import 套件\n\n[pipx](https://github.com/pypa/pipx/) - 類似 linux 中的 apt, 更方便管理套件. - [youtube tutorial - python 套件介紹](https://youtu.be/9cXDjWJhjsU)\n\n指定 python 版本\n\n```cmd\npipx install --python python3.8 flake8\n```\n\n查看目前安裝套件\n\n```cmd\npipx list\n```\n\n[commitizen and pre-commit](commitizen_pre_commit_tutorial) - 規格化 commit 以及 pre-commit\n\n[pip-audit](https://pypi.org/project/pip-audit/) - 檢查 packages 安全性.\n\n首先, 不要用 sudo/admin 下載 packages.\n\n`pip install pip-audit`\n\n使用方法很簡單, `pip-audit --fix` 直接幫你更新有問題的 packages.\n\n[pyenv](pyenv_tutorial) - 更好用的 python 管理虛擬環境工具(管理多版本)\n\n[pip-tools_tutorial](pip-tools_tutorial) - 幫你管理依賴套件的版本\n\n[uv](uv_tutorial) - 超快的套件管理工具.\n\n## 如何使用\n\n基本上，每個 python 檔案都可以直接執行。\n\u003e python  xxxx.py\n\n範例\n\n\u003e python  defaultdict_tutorial.py\n\n## 執行環境\n\n* Python 3.9\n\n## Reference\n\n* [python-anti-patterns](https://docs.quantifiedcode.com/python-anti-patterns/index.html)\n* [python-patterns](https://github.com/faif/python-patterns)\n* [python-programming](https://www.programiz.com/python-programming)\n\n## Donation\n\n文章都是我自己研究內化後原創，如果有幫助到您，也想鼓勵我的話，歡迎請我喝一杯咖啡 :laughing:\n\n綠界科技ECPAY ( 不需註冊會員 )\n\n![alt tag](https://payment.ecpay.com.tw/Upload/QRCode/201906/QRCode_672351b8-5ab3-42dd-9c7c-c24c3e6a10a0.png)\n\n[贊助者付款](http://bit.ly/2F7Jrha)\n\n歐付寶 ( 需註冊會員 )\n\n![alt tag](https://i.imgur.com/LRct9xa.png)\n\n[贊助者付款](https://payment.opay.tw/Broadcaster/Donate/9E47FDEF85ABE383A0F5FC6A218606F8)\n\n## 贊助名單\n\n[贊助名單](https://github.com/twtrubiks/Thank-you-for-donate)\n\n## License\n\nMIT license\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwtrubiks%2Fpython-notes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwtrubiks%2Fpython-notes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwtrubiks%2Fpython-notes/lists"}