MC202602: Python Meeting 06: P02_18: PO for items on slow rotation
Python Meeting Replay
Python Meeting PDF
Set-up the python project
There are three options for setting up the python project:
- Option 1: Download files manually. Manually set-up the folders (see screenshots below) and put the files in each relevant folder, as per the below instructions
- Option 2: Download the zip file from the GitHub link below and unzip on your computer.
- Option 3: Synchronize the project from GitHub. Use the GitHub repository link to clone the GitHub project directly to your computer.
Option 1: Download files manually
If you choose the first option, follow the following steps:
1.1: Create folders
Create a project folder on your PC, as shown below but replacing the XX with the number of the Python meeting. This project folder will be the root folder. Within the root folder, create the folders 01_SOURCES, 02_PROGRAMMES and 03_RESULTS. Use these exact same names. Make sure that these folders are all in the same project root folder. Do not mix folders from different python sessions together.
Folders to create in your project root:

Within the 02_PROGRAMMES folder, you should create a sub-folder named Z_SHARED_FUNCTIONS:
Folder to create inside 02_PROGRAMMES:

1.2: Files to put inside the 01_SOURCES folder
During the live session we will use the following source files. These files should go in the folder 01_SOURCES.
1.3: Files to put inside the 02_PROGRAMMES folder -> python files: change extension to .py
During the python session, we will run the following program. You will need to change the extension of the python program to .py.
1.4 File to put inside the 02_PROGRAMMES folder -> requirements.txt
The requirements.txt file holds the list of python libraries and their versions for all of the python libraries that are used by the project.
1.5: File to put inside the 02_PROGRAMMES folder -> pyproject.toml
The pyproject.toml is not actually used technically. However, it is good practice to use this file to remember the python version that goes with the library versions that we put in requirements.txt
1.6: File to put inside the 02_PROGRAMMES folder -> .env — change extension from .env.example to .env
An .env file is normally a secret file that you do not share with anyone. The .env file is where you will put your secret keys for logging into other systems, such as openAI or Copilot. You can create a .env file inside Visual Studio Code. The .env file does not have a name, only the extension .env. For this project, the .env should be set to contain the root folder address of the project.
1.7: File(s) to put inside the Z_SHARED_FUNCTIONS folder
The following are python programmes. You should create a Z_SHARED_FUNCTIONS folder in your 02_PROGRAMMES folder and store these files in Z_SHARED_FUNCTIONS. You should change the extension to .py:
1.8: File(s) to put inside the 03_RESULTS folder
When you run the python program, it will generate a results file and export it as an Excel file. You can see the example of what you would expect to obtain here. You can put this file in your 03_RESULTS folder:
Option 2: Download zip file from GitHub
You can go to the link: Python meeting 06, click on the button Code and choose “Download ZIP”.

Option 3: Clone the project from GitHub
If you would like to get the project from github, clone from the following link – based on the instructions in the Python Cheat Sheet below: If you would like to get the project from github, clone from the following link – based on the instructions in the Python Cheat Sheet below: https://github.com/300Academy/PYTHON_MEETING_06.git
Python Cheat Sheet – including GitHub instructions
To understand how to obtain the project from GitHub, go to the section on GitHub of the document below. Please note that .env files are designed to hold secret information. For this reason, the .env file is not included in GitHub. You should create your own .env file or use the one attached above in this lesson. You should put the .env file in the /02_PROGRAMMES folder. You should update the content of the variable(s) – not the names of the variables– in the .env file to match your own environment. Note: for folder paths, do not include the last .
Responses