Skip to content

rambasnet/Object-Oriented-Programming-Design-Patterns

Repository files navigation

Object Oriented Programming & Design Patterns

Test Binder Open In Colab Python License

  • Jupyter Notebooks for learning Object-Oriented Programming and Design Patterns using Python
  • notebooks are provided in the notebooks folder

Text: Python Object Oriented Programming

  • Fourth Edition by Steven F. Lott and Dusty Phillips

How to use the notebooks

Important

To learn to code, it's very important to type code on your own from scratch and NOT copy-paste! You can run provided cells to see the output, follow along, and learn from it. However, it's very important that you either start a new notebook or add cells and write your code from scratch to practice the concepts covered with many similar examples and solve the exercises provided for self-assessment.

Online services

You can launch an interactive session of this project using the online Binder service: Binder or Google Colab. Each chapter, where applicable, provides Open In Colab to simply click and run the notebook in Google's Colab environment.

On a local system

To run these notebooks interactively and save your work locally, you need Python 3 and Jupyter Notebook -- an interactive web-based editor that allows you to create and share documents that contain live code and data. Anaconda or Miniconda is the recommended way to install Python and other packages on all modern platforms.

Using Docker

  • Install Docker on your system: https://docs.docker.com/get-docker/

  • Dockerfile is provided to build a container image with all the necessary packages and dependencies to run the notebooks. You can build the image and run the container using the provided bash scripts.

  • Clone this repo and run the following command from the root of the repo

  • Use git-bash Terminal on Windows to run bash scripts

    git clone https://github.com/rambasnet/Python-Object-Oriented-Programming.git
    bash run-jupyter.sh # run jupyter notebook server in the container
  • Jupiter Notebooks are inside the notebooks folder
  • start from the notebbooks/OO-Table-of-Contents.ipynb

Installing via Anaconda or Miniconda

Anaconda or Miniconda has Python 3 and many other packages that you can easily install on any platform (Windows, Linux, and Mac). First, install Anaconda: http://docs.continuum.io/anaconda/install/ or Miniconda https://conda.io/docs/user-guide/install/index.html for Python 3.

After installing anaconda or miniconda, open a terminal or cmd prompt and run the following commands:

    conda update conda
    conda env list # list current environments
    conda env remove -n <environment_name> # remove existing environment
    conda create -n oop python=3.10 # create a new virtual environment named py
    conda activate oop
    conda install notebook # or
    conda install -c conda-forge retrolab # uses notebook
    conda install mypy # type checker
    python -m pip install hypothesis # test data generator

Running the notebooks in VS Code

  • Python notebooks can be run natively in VS Code. Simply open the notebook file with extension .ipynb in VS Code and run each cell; add new cell, etc. right from VS Code.

Running the notebooks using jupyter notebook server

Once Python 3 and Jupyter Notebook are installed, open a terminal change the working directory using cd command to go into the folder where this repo is cloned and run the notebook from there. Use notebook or retro.

    cd <directory where this repo is cloned>
    jupyter notebook # or
    jupyter retro

This will start a Jupyter session in your browser. Start from the notebbooks/OO-Table-of-Contents.ipynb

About

Class Notes for Object Oriented Programming - Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published