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 08:57] – skipidar | programming:python [2024/04/14 16:13] (current) – [Virtual environments] skipidar | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Python ====== | ===== Python ====== | ||
| - | === Install on Wndows === | + | ==== Install on Wndows |
| - | == Package Manager PIP == | + | == Installing python |
| Python (instead of Active Python, which adds enterprise support) | Python (instead of Active Python, which adds enterprise support) | ||
| < | < | ||
| Line 11: | Line 11: | ||
| - | == Package Manager | + | == INstalling package manager |
| < | < | ||
| # download get-pip.py from here https:// | # download get-pip.py from here https:// | ||
| Line 18: | Line 18: | ||
| </ | </ | ||
| - | Then add the following location to the environment variable Path. There " | + | Then add the following location to the environment variable Path. There " |
| < | < | ||
| - | == Use package maanger == | + | == Use package maanger |
| < | < | ||
| # restart the shell after updating the PATH and execute for example | # restart the shell after updating the PATH and execute for example | ||
| pip install boto3 | pip install boto3 | ||
| </ | </ | ||
| + | |||
| + | == Configure IDE == | ||
| + | Istall Intelij community edition: \\ | ||
| + | https:// | ||
| + | |||
| + | Install the Python plugin: | ||
| + | https:// | ||
| + | |||
| + | Start a new Python Project. | ||
| + | |||
| + | Validate your Project uses Interpreter from your Python installation. \\ | ||
| + | https:// | ||
| + | |||
| + | Create a new *.py file | ||
| + | |||
| + | <sxh py> | ||
| + | import json | ||
| + | import logging | ||
| + | |||
| + | import boto3 | ||
| + | |||
| + | ... | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== 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.1501837030.txt.gz · Last modified: (external edit)
