Skip to content


 Zabbix
 Grafana
 Prometheus
 Threejs and TypeScript
 SocketIO and TypeScript
 Blender Topological Earth
 Sweet Home 3D
 Design Patterns Python
 Design Patterns TypeScript
   
 Course Coupon Codes
Three.js and TypeScript
Kindle Edition
$9.99 $14.99 Paperback 
$29.99 $34.99




Design Patterns in TypeScript
Kindle Edition
$9.99 $14.99 Paperback
$19.99 $24.99




Design Patterns in Python
Kindle Edition
$9.99 $14.99 Paperback
$19.99 $24.99




Development Environment Setup

Video Lecture

Development Environment Setup Development Environment Setup Development Environment Setup

Overview

The most universal approach to installing Python is to visit the official Python download page at,

https://www.python.org/downloads/

Normally this page will detect your operating system from the useragent in your browser and select which install is appropriate for you.

There will be 64 and 32 bit versions for your operating system. At the time of writing this documentation, the option of downloading the 64bit version was the most common, and the version was 3.9.x.

The code in this documentation will be using a simplified generic style of Python that should work in all versions since Python version 3.

To test if you already have python on your system, depending on your operating system, whether Windows, Linux or Mac OSX, open a terminal/bash/cmd or PowerShell prompt.

and type

1
python -V

Note the capital V in the above command.

Sometimes python is named as python3

So you can also try

1
python3 -V

You are looking for a response that indicates you have Python 3 or above installed. Not an error, or Python 2.x

On my windows workstation, if I use PowerShell, the response is

1
2
PS> python -V
Python 3.9.2

I have Python3 already installed using the official python link from above.

If you are using a recent version of Linux or Mac OSX, then the command to check for the Python version on your system is most likely to be,

1
python3 -V

Remember to follow the official install instructions for your operating system at https://www.python.org/downloads/

Course Code

All the code examples in this documentation can be viewed from my GitHub repository at https://github.com/Sean-Bradley/Design-Patterns-In-Python

If you have Git installed, you can download a copy locally using the command

1
git clone https://github.com/Sean-Bradley/Design-Patterns-In-Python.git

or you can download a zip of all the code, by visiting this link in your browser

https://sbcode.net/python/zips/Design-Patterns-In-Python.zip

or using wget on Linux

1
2
3
4
wget https://sbcode.net/python/zips/Design-Patterns-In-Python.zip
sudo apt install unzip
unzip Design-Patterns-In-Python.zip
cd Design-Patterns-In-Python/

You can then experiment with the code at your own pace and try out different variations.

If you would rather type the code from the documentation, then follow these further recommendations.

On my system, I have created a working folder on one of my spare drives, E:\, and then created a new folder in it named python_design_patterns, and then cd into it. You can use a different folder name if you prefer.

1
2
3
PS C:\> e:
PS E:\> mkdir python_design_patterns
PS E:\> cd .\python_design_patterns

Each section will be in a new folder named after the design pattern section.

I.e,. The code that I write for the Factory pattern will be in its own subfolder named factory

1
2
3
PS E:\python_design_patterns> mkdir factory
PS E:\python_design_patterns> cd .\factory
PS E:\python_design_patterns\factory> 

VSCode

If you are working on Windows, then I recommend to also install VSCode to use as your IDE when learning Python.

This is optional and you may prefer to use Notepad or any other popular IDE that you can download or use online that will also assist you when writing Python.

You can download VSCode from https://code.visualstudio.com/download

You can then open VSCode from your current working folder by typing code .

1
PS E:\python_design_patterns> code .

And VSCode will open ready for you in your working folder where you can use it to add new files or folders as needed.

Open VSCode