This repository contains a collection of Python practices designed to help you learn and master the Python programming language. Follow the instructions below to set up your environment and start working through the exercises.
Before you begin, make sure you have the following installed on your machine:
- Python 3.x
- pip (Python package installer)
- Jupyter Notebook
- .NET SDK (for C# support)
To enhance your development experience, consider installing the following Visual Studio Code extensions:
- Jupyter Extension for Visual Studio Code: Provides Jupyter notebook support in VS Code.
- VS Code Insiders and .NET Polyglot Notebooks: Enables .NET interactive notebooks in VS Code.
Follow these steps to set up your environment:
-
Create a virtual environment:
python3 -m venv .venv
-
Activate the virtual environment:
- On Linux/macOS:
source .venv/bin/activate
- On Windows:
.venv\Scripts\activate
- On Linux/macOS:
-
Verify the virtual environment:
python -m site python -m pip list
-
Install Jupyter Notebook support:
python -m pip install jupyter
Or install from the requirements file:
python -m pip install -r requirements.txt
-
Check the Jupyter kernel:
jupyter kernelspec list
-
Install .NET interactive for Jupyter (if needed):
dotnet tool install -g dotnet-try export DOTNET_ROLL_FORWARD=LatestMajor export DOTNET_TRY_CLI_TELEMETRY_OPTOUT=1 dotnet try jupyter install
-
Save dependencies if changed:
python3 -m pip freeze > requirements.txt
-
Select the newly created virtual environment for the
python-workbook.ipynb
notebook.
If you need to install multiple versions of Python, follow these steps:
-
Add the deadsnakes PPA:
sudo add-apt-repository ppa:deadsnakes/ppa --yes
-
Update and upgrade your system:
sudo apt update && sudo apt upgrade -y
-
Install Python 3.11:
sudo apt install python3.11 -y
-
Verify the installation:
python3.11 --version python3.11 -m pip list