Getting Python Ready on Your Machine
Before you write a single line of Python, you need the right tools installed and a clear sense of why Python matters for your specific role. This module covers exactly that โ no fluff, just a working setup and the confidence to move forward.
What exactly is Python?
Python is a general-purpose programming language โ which is just a fancy way of saying it can do almost anything. You can use it to automate repetitive tasks, pull data from a database, build a REST API, train a machine learning model, or send automated email reports. It reads almost like English, which is a big deal if you’ve never written code before.
Consider this: if you spend 30 minutes every morning downloading a report, reformatting it in Excel, and emailing it to your team, Python can do all of that in about 5 seconds, unattended, every day. That’s not an exaggeration. That’s just what it does.
Why is Python the right choice for corporate teams?
There are dozens of programming languages out there. C, Java, JavaScript, Ruby, Go โ the list goes on. Python sits in a sweet spot that most others don’t:
- Low barrier to entry. You don’t need a Computer Science degree. Most corporate professionals with no coding background pick up the basics within a few weeks.
- Huge ecosystem. Need to connect to Oracle DB? There’s a library for that. Need to call an AWS API? Library for that too. Need to scrape a website or train a classifier? Covered.
- Industry standard. Python is the dominant language in data science, AI/ML, DevOps, and automation. Learning it puts you in the same conversation as the engineers building these systems.
- Readable code. Six months after you write a Python script, you can still read it and understand what it does. That’s not always true with other languages.
What Python looks like for your role
Python doesn’t mean the same thing to everyone. Here’s a quick map of where it fits depending on where you sit in your organisation:
| Your Role | What Python Helps You Do | First Real Use Case |
|---|---|---|
| IT Support | Automate ticket creation, system health checks, user provisioning | Script that checks disk space on 50 servers and emails the results |
| Database Developer | Query Oracle/PostgreSQL, export to Excel, schedule reports | Python script that runs a SQL query and exports results to a formatted Excel file |
| DevOps / Cloud | Interact with AWS/GCP APIs, parse YAML configs, CI/CD scripting | Boto3 script to start/stop EC2 instances on a schedule |
| AI / ML Engineer | Data wrangling, model training, calling LLM APIs | Pandas script to clean a messy CSV, plot trends with Matplotlib |
| Automation | End-to-end workflow scripting, report generation, email bots | Automated morning report โ pull data, process, format, email |
Python version: which one do I install?
At the time of writing, Python 3.12 is the current stable release and the one you should install. Python 2 was retired in 2020 โ if you ever see tutorials using print "hello" without parentheses, they’re outdated. Ignore them and use Python 3.
The Python tools you’ll actually use
You need two things to get started: Python itself (the language interpreter), and a code editor (where you write your scripts). We’ll install both in the Setup section below. For those working in data or AI roles, we’ll also cover Jupyter Notebook โ a browser-based environment that lets you run code and see results side by side, which is perfect for analysis work.
Step 1 โ Download & install Python
# On Windows โ type this in Command Prompt
python --version
# On macOS / Linux โ type this in Terminal
python3 --version
# Expected output (your version may differ slightly):
Python 3.12.3
Step 2 โ Install Visual Studio Code
VS Code is the editor we recommend for this tutorial. It’s free, made by Microsoft, and has excellent Python support. Download it from code.visualstudio.com and run the standard installer.
After installing VS Code, open it and install the Python extension:
Step 3 โ Python REPL: your interactive playground
The REPL (Read-Eval-Print Loop) is Python’s interactive shell. Think of it as a scratchpad where you type one line of Python, press Enter, and immediately see the result. It’s perfect for trying out ideas quickly without creating a file.
# Start the REPL by typing 'python' or 'python3' in your terminal
# You'll see a >>> prompt. Try these:
>>> 2 + 2
4
>>> print("Hello from Python!")
Hello from Python!
>>> 10 * 5
50
# To exit the REPL, type:
>>> exit()
Step 4 โ Your first Python script (.py file)
A script is just a plain text file saved with a .py extension. You write your code in the file, save it, and then run it from the terminal. This is how real Python programs are built.
# This is your first Python script
# Save this as hello.py and run it from the terminal
print("Hello, World!")
print("Python is running on my machine.")
print("I am ready to learn Python.")
# Navigate to the folder where you saved hello.py, then:
# Windows:
python hello.py
# macOS / Linux:
python3 hello.py
# Expected output:
Hello, World!
Python is running on my machine.
I am ready to learn Python.
Step 5 โ Jupyter Notebook (for Data & AI roles)
If you’re in a data, AI, or analytics role, Jupyter Notebook is something you’ll use daily. It runs in your browser and lets you mix code, output, charts, and notes in one document. Install it using pip โ Python’s built-in package manager.
# Install Jupyter using pip (Python's package installer)
pip install notebook
# Start Jupyter โ it opens automatically in your browser
jupyter notebook
# Your browser will open at http://localhost:8888
# Click "New" โ "Python 3" to create your first notebook
The standard “Hello World” program is fine for a textbook. But you’re a working professional, so let’s make these first programs mean something. Each example below is a simple program built around a real scenario from your role.
A simple script that greets the user by name, tells them the current date, and confirms that their Python setup is working. This is exactly the kind of small utility you’d write to test a new environment.
import datetime
name = "Support Engineer"
today = datetime.date.today()
print(f"Hello, {name}!")
print(f"Today's date is: {today}")
print("Python setup confirmed. You're good to go.")
# Output:
# Hello, Support Engineer!
# Today's date is: 2026-06-14
# Python setup confirmed. You're good to go.
DBAs and DevOps engineers often need to quickly check what environment they’re running on. This script uses Python’s built-in platform module to print system information โ the kind of thing you’d run at the start of any new server setup.
import platform
import sys
print("=== System Info Check ===")
print(f"OS : {platform.system()} {platform.release()}")
print(f"Machine : {platform.machine()}")
print(f"Python version: {sys.version}")
print(f"Python path : {sys.executable}")
print("=========================")
# Sample Output (Windows):
# === System Info Check ===
# OS : Windows 10
# Machine : AMD64
# Python version: 3.12.3 (main, Apr 9 2024, ...)
# Python path : C:\Python312\python.exe
# =========================
Before starting any data science project, it’s good practice to confirm that your key libraries are installed and print their versions. This script checks for commonly used libraries and gracefully handles the case where one isn’t installed yet.
# Check if key data science libraries are installed
libraries = ["numpy", "pandas", "matplotlib", "sklearn"]
print("Checking AI/ML environment...\n")
for lib in libraries:
try:
mod = __import__(lib)
version = getattr(mod, "__version__", "installed")
print(f" โ {lib:15} {version}")
except ImportError:
print(f" โ {lib:15} NOT INSTALLED โ run: pip install {lib}")
print("\nEnvironment check complete.")
# Sample Output:
# โ numpy 1.26.4
# โ pandas 2.2.1
# โ matplotlib NOT INSTALLED โ run: pip install matplotlib
When setting up Python on a new machine, you often need to install a list of packages. Rather than typing pip install one by one, here’s a small script that reads a list and installs them all โ a pattern you’ll reuse throughout this course.
import subprocess
import sys
# List of packages to install
packages = ["requests", "pandas", "openpyxl"]
print("Installing required packages...\n")
for package in packages:
print(f"Installing {package}...")
result = subprocess.run(
[sys.executable, "-m", "pip", "install", package],
capture_output=True,
text=True
)
if result.returncode == 0:
print(f" โ {package} installed successfully")
else:
print(f" โ {package} failed โ check your internet connection")
print("\nAll done!")
These exercises don’t need any Python knowledge beyond what’s in this module. The goal is simply to confirm you can write, save, and run a Python script successfully.
about_me.py. Use print() to display your name, your job role, your department, and one thing you hope to automate with Python.
print() function for this one. Put each piece of information inside its own print statement. Strings (text) go inside quote marks โ either single 'hello' or double "hello" โ both work fine.
*, division is /, and “to the power of” is **. So 2 to the power of 10 is 2 ** 10. Expected answers: 30883, 128.0, and 1024.
sysinfo.py, and run it with python sysinfo.py. The import modules (platform, sys) are built into Python โ no installation needed.
๐ M0 Assignment โ My Python Setup Report
Create a Python script called setup_report.py that does all of the following:
- Prints a neat header:
=== My Python Setup Report === - Prints your name and your job role (hard-coded is fine for now)
- Prints today’s date using the
datetimemodule (see Syntax section, Step 4) - Prints your Python version and OS using the
platformandsysmodules (Example 2) - Checks whether
requestsis installed โ print “โ requests is available” or “โ requests not found” (Example 3 pattern) - Prints a closing line:
Setup complete. Ready for M1.
Answer all five questions and click Submit Quiz. You’ll see which answers are correct, along with an explanation for each. Aim for 4/5 or higher before moving to M1.
