Small repository demonstrating how duck typing in python allows modules to work work with instances without needing to import.
Follow these directions once, when retrieving this repository.
- Navigate to your projects folder named
projects
$ cd ~/Developer/projects
- In Github click on the "Fork" button in github and fork the repository to your Github account. This will make a copy of the repository in your github account.
- "Clone" (download a copy of this repository) into your projects folder. This command makes a new folder called
duck-typing
, and then puts the repository into this new folder.
$ git clone ...
Use ls
to confirm there's a new repository folder
- Move your location into this repository folder
$ cd duck-typing
- This repository does not need a
venv
, and has no dependencies to be installed (usingpip
).
Summary of one-time repository setup:
-
cd
into yourprojects
folder - Clone the repository onto your machine
-
cd
into theduck-typing
folder
The sample code can be run with the following command
python3 main.py