Skip to content

Latest commit

 

History

History
101 lines (78 loc) · 2.9 KB

README.md

File metadata and controls

101 lines (78 loc) · 2.9 KB

Python Practices to Learn the Language

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.

Prerequisites

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)

Recommended VS Code Extensions

To enhance your development experience, consider installing the following Visual Studio Code extensions:

Setup the Workbook

Follow these steps to set up your environment:

  1. Create a virtual environment:

    python3 -m venv .venv
  2. Activate the virtual environment:

    • On Linux/macOS:
      source .venv/bin/activate
    • On Windows:
      .venv\Scripts\activate
  3. Verify the virtual environment:

    python -m site
    python -m pip list
  4. Install Jupyter Notebook support:

    python -m pip install jupyter

    Or install from the requirements file:

    python -m pip install -r requirements.txt
  5. Check the Jupyter kernel:

    jupyter kernelspec list
  6. 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
  7. Save dependencies if changed:

    python3 -m pip freeze > requirements.txt
  8. Select the newly created virtual environment for the python-workbook.ipynb notebook.

Install Multiple Python Versions

If you need to install multiple versions of Python, follow these steps:

  1. Add the deadsnakes PPA:

    sudo add-apt-repository ppa:deadsnakes/ppa --yes
  2. Update and upgrade your system:

    sudo apt update && sudo apt upgrade -y
  3. Install Python 3.11:

    sudo apt install python3.11 -y
  4. Verify the installation:

    python3.11 --version
    python3.11 -m pip list

References