Skip to content

Comprehensive Python Workshop: Mastering Fundamentals and Advanced Techniques

License

Notifications You must be signed in to change notification settings

mr-pylin/python-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

79 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐍 Python Workshop

License Python Version Codacy Badge Code Style Repo Size Last Updated PRs Welcome

Comprehensive Python Workshop: Mastering Fundamentals and Advanced Techniques.

πŸ“– Table of Contents

πŸ“– Main Notebooks

  1. Introduction to Python
    A beginner-friendly introduction to Python, its features, and basic syntax.
  2. Data Structures
    Explore essential data structures like int, float, list, tuple, dictionary, and set.
  3. Index and Slice
    Learn how to access and manipulate elements of sequences using indexing and slicing.
  4. Operators and Operands
    Study various operators (arithmetic, comparison, logical, etc.) and how they work with operands.
  5. Type Conversions
    Understand how to convert data types in Python with explicit and implicit conversions.
  6. Conditional Statements
    Learn about if-elif-else and match-case statements for controlling the flow of your programs.
  7. Loops
    Master loops (for, while) to iterate over sequences and perform repeated tasks.
  8. Functions
    Understand how to define and use functions, including parameters and return values.
  9. Built-In Functions
    Explore Python's powerful built-in functions and how to leverage them in your programs.
  10. Namespaces and Scopes
    Learn about namespaces and scope resolution to avoid name conflicts in your code.
  11. Anonymous Functions (Lambda)
    Discover the usage of lambda expressions for creating small, anonymous functions.
  12. Pack and Unpack Data
    Learn how to pack multiple values into a variable and unpack them in Python.
  13. Type Hints and Docstrings
    Understand how to improve code readability with type hints and document your functions with docstrings.
  14. Dependencies
    Learn how to manage and install dependencies using pip and requirements.txt and use them in your code.
  15. Comprehensions
    Master list, set, dictionary, and generator comprehensions for concise and readable code.
  16. Introduction to Object-Oriented Programming (OOP)
    Get introduced to the basic concepts of object-oriented programming in Python.
  17. Closures and Decorators
    Learn about closures and how to use decorators for enhancing functions.
  18. Object-Oriented Programming Concepts
    Explore core OOP concepts such as encapsulation, inheritance, polymorphism, and abstraction.
  19. Context Managers
    Learn to manage resources efficiently using with statements and defining custom context managers.
  20. Special Methods
    Discover Python's dunder (double underscore) methods for creating custom behavior in your classes.
  21. Errors and Exceptions
    Learn about handling errors and exceptions to make your code more robust.
  22. Meta Classes
    Dive into metaclasses to understand how classes in Python are created and customized.
  23. Singleton Design
    Understand the Singleton Design Pattern for ensuring a class has only one instance, with examples in Python.

πŸ“– Built-in Methods

πŸ“‹ Prerequisites

  • πŸ’» Basic Computer Skills
    • Familiarity with using a computer, web browsers, and file management.
  • 🐍 Python Environment Setup

βš™οΈ Setup

This project requires Python v3.10 or higher. It was developed and tested using Python v3.12.8. If you encounter issues, consider using this specific Python version.

πŸ“ List of Dependencies

Installing matplotlib, numpy, pandas, and torch is OPTIONAL. They are used exclusively in the Dependencies Notebook to demonstrate how to import and manage dependencies effectively.

ipykernel ipywidgets matplotlib numpy pandas torch

πŸ“¦ Install Dependencies

πŸ“¦ Method 1: Poetry (Recommended)

Use Poetry for dependency management. It handles dependencies, virtual environments, and locking versions more efficiently than pip. To install dependencies using Poetry:

  • Option 1 [Recommended]: Install exact dependency versions specified in poetry.lock for consistent environments:

    poetry install
  • Option 2: Install the latest compatible dependency versions from pyproject.toml and regenerate the poetry.lock file:

    poetry install --no-root

πŸ“¦ Method 2: Pip

Install all dependencies listed in requirements.txt using pip:

pip install -r requirements.txt

🌐 Connection Issues

If you encounter connection issues during installation, you can try extending the timeout and increasing the number of retries with the following:

  • For Poetry: Use the following command to set the retries and timeout directly in the terminal before running the install:

    • Windows:

      • PowerShell:

        $env:POETRY_HTTP_TIMEOUT=300
        $env:POETRY_HTTP_RETRIES=10
      • Command Prompt:

        set POETRY_HTTP_TIMEOUT=300
        set POETRY_HTTP_RETRIES=10
    • Linux/macOS:

      • Terminal:

        export POETRY_HTTP_TIMEOUT=300
        export POETRY_HTTP_RETRIES=10
  • For Pip: Use the --retries and --timeout flags directly in your pip command:

    pip install -r requirements.txt --retries 10 --timeout 300

πŸ› οΈ Usage Instructions

  1. Open the root folder with VS Code (Ctrl/Cmd + K followed by Ctrl/Cmd + O).
  2. Open .ipynb files using the Jupyter extension integrated with VS Code.
  3. Select the correct Python kernel and virtual environment where the dependencies were installed.
  4. Allow VS Code to install any recommended dependencies for working with Jupyter Notebooks.

✍️ Notes:

  • It is highly recommended to stick with the exact dependency versions specified in poetry.lock or requirements.txt rather than using the latest package versions. The repository has been tested on these versions to ensure compatibility and stability.
  • This repository is actively maintained, and dependencies are updated regularly to the latest stable versions.
  • The table of contents embedded in the notebooks may not function correctly on GitHub.
  • For an improved experience, open the notebooks locally or view them via nbviewer.

πŸ”— Useful Links

Python

  • Official Website:
    • The main website for Python, offering downloads, news, and community resources.
    • Official site: python.org
  • Documentation
    • Comprehensive guide and reference for all functionalities and features of the Python programming language.
    • Doc: docs.python.org
  • Source Code

Looking Ahead

πŸ” Find Me

Any mistakes, suggestions, or contributions? Feel free to reach out to me at:

I look forward to connecting with you! πŸƒβ€β™‚οΈ

πŸ“„ License

This project is licensed under the Apache License 2.0.
You are free to use, modify, and distribute this code, but you must include copies of both the LICENSE and NOTICE files in any distribution of your work.

✍️ Additional Licensing Information

  • SVG Images:
    • The SVG images located in the ./assets/images/svgs/ folder are licensed under the CC BY-ND 4.0.
    • Note: This license restricts derivative works, meaning you may share these images but cannot modify them.

About

Comprehensive Python Workshop: Mastering Fundamentals and Advanced Techniques

Topics

Resources

License

Stars

Watchers

Forks