Before diving into Programming, Test Automation, Machine Learning, and other awesome things you can do with Python, you need to setup your machine and IDE properly.
In this video, I go over my preferred Python setup using pyenv as my interpreter manager, poetry as my package manager, and VS Code as my IDE. The rest of my Python videos (from now on) will most likely be using this setup, so it's good to know how to follow along.
Steps
----------
1. Install pyenv - github.com/pye...
If on Mac, use $ brew install pyenv
Install a Python interpreter, like $ pyenv install 3.8.6
Set it globally with $ pyenv global 3.8.6
2. Install poetry - python-poetry.org
$ pip install poetry
3. Start the Project
Install Python and Pylance Extensions
Initialize your Python Project (with $ poetry init) and follow the guide
$ poetry install
$ poetry add [PACKAGE] to install any additional packages
3a. Setup VS Code - code.visualstu...
Find the virtual environment path that poetry created (with $ poetry env info)
Open Command Palette, then Python: Select Interpreter
If you followed along in the video, we installed pyleniumio which comes with pytest, so now we open the Command Palette again, then Python: Configure Tests
OPTIONAL - Configure Linter and Formatter, or just use Pylance's built-in functionality
21 окт 2024