From 88e7d70c5b663ce12b15b2baa6f05bc4a24cdbba Mon Sep 17 00:00:00 2001 From: Hong Date: Fri, 17 Jan 2025 14:04:04 +0800 Subject: [PATCH] Update docs --- docs/Network_and_Protocols/network.md | 2 + docs/Provisioning/Ansible.md | 3 ++ .../programming_languages/python/python.md | 45 ++++++++++++++----- 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/docs/Network_and_Protocols/network.md b/docs/Network_and_Protocols/network.md index 2274d39..080be10 100644 --- a/docs/Network_and_Protocols/network.md +++ b/docs/Network_and_Protocols/network.md @@ -2,6 +2,8 @@ ## guides/tips/misc...etcs +* [netlab: a Virtual Networking Labbing Tool with Python](https://netlab.tools/) + * [github.com/ipspace/netlab](https://github.com/ipspace/netlab) * [AWS/What’s the Difference Between a Proxy and a VPN?](https://aws.amazon.com/compare/the-difference-between-proxy-and-vpn/) * [The C10K problem](http://www.kegel.com/c10k.html) * [smallnest/network_benchmark](https://github.com/smallnest/network_benchmark) diff --git a/docs/Provisioning/Ansible.md b/docs/Provisioning/Ansible.md index 93f672c..14773dd 100644 --- a/docs/Provisioning/Ansible.md +++ b/docs/Provisioning/Ansible.md @@ -2,6 +2,9 @@ ## Guides/tips...etc +* [ansible-lint/discussions/3002/ansible-lint (X.X.X) depends on will-not-work-on-windows-try-from-wsl-instead (*)...etc](https://github.com/ansible/ansible-lint/discussions/3002) +* [Other Tools and Programs](https://docs.ansible.com/ansible/latest/community/other_tools_and_programs.html#other-tools-and-programs) +* [Asynchronous actions and polling](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_async.html#playbooks-async) * [installing-ansible-to-containers](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-to-containers) * Ansuble version support matrix * [ansible-core support matrix](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix) diff --git a/docs/computer languages/programming_languages/python/python.md b/docs/computer languages/programming_languages/python/python.md index 00861f6..8189627 100644 --- a/docs/computer languages/programming_languages/python/python.md +++ b/docs/computer languages/programming_languages/python/python.md @@ -30,6 +30,29 @@ From Python docs: * More details, please click all of these URL links or do somtheing coding test to prove these ideas. +2. Why are virtual environments used in Python projects? +A. To improve code execution speed. +B. To isolate project dependencies. +C. To simplify syntax. +D. To reduce memory usage. + +Answer: It should be B. To isolate project dependencies. + +For My Python coding experience, I would use pyenv + poetry to lock a python interpreter version and manage project dependencies. +Or from this meme comic: [Python Environment](https://xkcd.com/1987/) +![Python Environment](https://imgs.xkcd.com/comics/python_environment.png) + +3. What is the output of the following code snippet? +x = (1, 2, 3) +x[0] = 10 + +A. (10, 2, 3) +B. TypeError: 'tuple' object does not support item assignment +C. (1, 2, 3) +D. None + +Answer: It should be To B. TypeError: 'tuple' object does not support item assignment + ## docs/news/guides/tips/misc... * [VizTracer is a low-overhead logging/debugging/profiling tool that can trace and visualize your python code execution.](https://github.com/gaogaotiantian/viztracer) @@ -58,6 +81,16 @@ From Python docs: ## collects/tips/tools/libraries/frameworks for setuping up coding environment +* pyenv + * manage python interpreter version + * [https://github.com/pyenv/pyenv#automatic-installer](https://github.com/pyenv/pyenv#automatic-installer) + * [set-up-your-shell-environment-for-pyenv](https://github.com/pyenv/pyenv#set-up-your-shell-environment-for-pyenv) + * [install-python-build-dependencies](https://github.com/pyenv/pyenv#install-python-build-dependencies) + * [Suggested build environment](https://github.com/pyenv/pyenv/wiki#suggested-build-environment) +* Poetry + * manage projects packages/virtual enviroment + * [Install ](https://python-poetry.org/docs/) + * [installing-dependencies-only](https://python-poetry.org/docs/basic-usage/#installing-dependencies-only) * [loguru/Python logging made (stupidly) simple ](https://github.com/Delgan/loguru) * Which Python version? * 2.7/3.8/3.9/3.10/3.11 @@ -69,18 +102,8 @@ From Python docs: * [Python Packaging Authority](https://www.pypa.io/en/latest/) * [rye](https://github.com/mitsuhiko/rye) * Rye: An Experimental Package Management Solution for Python -* Poetry - * [Install ](https://python-poetry.org/docs/) - * [installing-dependencies-only](https://python-poetry.org/docs/basic-usage/#installing-dependencies-only) - -* pyenv - * controll python version - * [https://github.com/pyenv/pyenv#automatic-installer](https://github.com/pyenv/pyenv#automatic-installer) - * [set-up-your-shell-environment-for-pyenv](https://github.com/pyenv/pyenv#set-up-your-shell-environment-for-pyenv) - * [install-python-build-dependencies](https://github.com/pyenv/pyenv#install-python-build-dependencies) - * [Suggested build environment](https://github.com/pyenv/pyenv/wiki#suggested-build-environment) * pipenv - * controll projects packages/virtual enviroment + * manage projects packages/virtual enviroment * [https://pipenv.pypa.io/en/latest/#install-pipenv-today](https://pipenv.pypa.io/en/latest/) * [shell-completion](https://pipenv.pypa.io/en/latest/advanced/#shell-completion) * [pipenv install throws --system is intended to be used for pre-existing Pipfile installation #5052](https://github.com/pypa/pipenv/issues/5052)