programming:python
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
programming:python [2017/08/04 09:01] – skipidar | programming:python [2024/04/14 16:13] (current) – [Virtual environments] skipidar | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Python ====== | ===== Python ====== | ||
- | === Install on Wndows === | + | ==== Install on Wndows |
== Installing python == | == Installing python == | ||
Line 41: | Line 41: | ||
Create a new *.py file | Create a new *.py file | ||
- | < | + | < |
import json | import json | ||
import logging | import logging | ||
Line 48: | Line 48: | ||
... | ... | ||
- | <sxh> | + | </sxh> |
+ | |||
+ | |||
+ | ==== Learn Python ==== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | |||
+ | ==== Async with Python ==== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | |||
+ | ==== Virtual environments ==== | ||
+ | |||
+ | ==What is a Virtual Environment? | ||
+ | |||
+ | A virtual environment is an isolated directory that contains its own Python interpreter, | ||
+ | |||
+ | |||
+ | <sxh shell> | ||
+ | # create the virtual environment | ||
+ | python3 -m venv .venv | ||
+ | |||
+ | # activate it | ||
+ | source .venv/ | ||
+ | |||
+ | # this should point to the python binary in your virtual environment | ||
+ | which python | ||
+ | |||
+ | # install dependencies in the virtual env | ||
+ | python -m pip install -r requirements.txt | ||
+ | </ |
programming/python.1501837307.txt.gz · Last modified: (external edit)