Part 9: Command-Line Tools & Automation with Python

Command-Line Tools & Automation in Python I’ve discovered that some of the most practical Python applications aren’t fancy data visualisations or machine learning models, but rather simple automation scripts that save time on repetitive tasks. In this post, I’ll walk through how to build command-line tools and automate everyday processes using Python. Building Command-Line Scripts with argparse When you’re working with financial data, you often need flexible tools that can handle different inputs. The argparse module lets you build command-line scripts that accept various arguments and options. ...

Part 8: Testing & Debugging Python Code

Testing & Debugging: Building Reliable Financial Tools When working with financial data and calculations, accuracy is essential. A small bug in your code could mean reporting incorrect figures, making flawed investment decisions, or even compliance issues. This post will guide you through testing and debugging techniques that ensure your financial Python code works correctly and reliably. Why Testing Matters in Finance Imagine you’ve created a Python script that calculates loan amortisation schedules. Your company uses this tool to price thousands of loans. If there’s an error in your interest calculation logic, even a small one, the financial impact could be enormous. ...

Part 7: Code Quality & Collaboration in Python

Code Quality & Collaboration: Building Finance Tools That Last As a finance professional learning Python, you’ll soon want to move beyond writing scripts just for yourself. Whether you’re building financial models, automating reporting, or creating data analysis tools, there comes a point when your code needs to be shared with colleagues or even the wider finance community. This post will guide you through best practices for creating high-quality, shareable code. ...

Part 6: Virtual Environments & Packaging in Python

Virtual Environments & Packaging in Python As your Python journey progresses and you start building more sophisticated financial tools, you’ll inevitably need to use external libraries. This is where virtual environments and package management become crucial skills. In this post, I’ll cover how to create isolated environments for your projects and manage dependencies effectively. Why Virtual Environments Matter Imagine this scenario: You’re working on two different financial applications. One requires pandas version 1.3 for compatibility with other tools, while the other needs the latest pandas 2.0 for new features. Without virtual environments, you’d be forced to choose one version for your entire system, potentially breaking one of your applications. ...

Part 5: Functions, Modules & File I/O in Python

Functions, Modules & File I/O in Python These next concepts incredibly useful for organising code and working with external data. Let’s explore how Python handles functions, modules, and file operations - all essential skills for financial analysis and reporting. Defining and Calling Functions Functions are reusable blocks of code that perform specific tasks. They help keep your code DRY (Don’t Repeat Yourself) and make it more maintainable. Basic Function Syntax def function_name(parameters): """Docstring explaining what the function does.""" # Function body return result # Optional Here’s a simple function that calculates compound interest: ...

Part 4: Core Data Structures in Python

Post 4: Core Data Structures Welcome to the fourth post in my Python learning journey. So far, we’ve installed Python, set up a development environment, and explored the basic syntax. Now it’s time to dive deeper into Python’s core data structures; the building blocks you’ll use to organise and manipulate data in your programs. In this post, we’ll cover: Lists: Python’s versatile sequence type Tuples: Immutable collections Dictionaries: Key-value mapping Sets: Unique value collections Choosing the right data structure I’ve found these data structures similar to concepts we use every day; lists are like columns in spreadsheets, dictionaries resemble lookup tables, and sets are perfect for tracking unique items like account codes. ...

Part 3: Python Syntax Fundamentals & Language Features

Post 3: Python Syntax Fundamentals & Language Features Welcome to the third post in my Python learning journey. In the first two posts, we installed Python and set up a proper development environment. Now it’s time to dive into the language itself. This post covers the fundamental building blocks of Python code that I’ve been learning. We’ll explore: Variables and basic data types Operators and expressions Control flow with conditionals and loops List comprehensions and lambdas Iterators and generators Error handling with try/except This post is a bit longer than the previous ones, but these fundamentals form the foundation of everything else in Python, so it’s worth taking the time to understand them. ...

Part 2: Text Editors vs. IDEs for Python Development

Post 2: Text Editors vs. IDEs for Python Development Welcome to the second post in my Python learning series. Last time, we got Python installed and ran our first code. Now it’s time to set up a proper coding environment. Working directly with .py files in Notepad gets tedious quickly, so let’s explore better options for writing Python code. In this post, we’ll cover: The difference between text editors and IDEs Popular options for Python development Setting up VS Code for Python (my personal choice) Key productivity features that will save you time Running and debugging Python code from your editor 1. Text Editors vs. IDEs: What’s the Difference? When I started learning Python, I was confused about whether to use a “text editor” or an “IDE”. Here’s the simple breakdown: ...

Part 1: Getting Started with Python on Windows

Post 1: Getting Started with Python on Windows Welcome to the first post in my Python learning series. As I learn Python myself, I’ll be documenting my journey here. This first post covers the essentials to get you up and running with Python on Windows: What Python is and why it’s worth learning Installing Python on Windows (with step-by-step instructions) Quick install notes for macOS & Linux users Writing your first “Hello, World!” program Using the Python interactive shell 1. What Is Python (and Why Learn It)? Python is a high-level, interpreted programming language that’s gained enormous popularity for good reason. After looking into various languages, I chose to learn Python because: ...

Python Development Environment Setup

Python Learning Path: From Fundamentals to Intermediate Applications

My Python Learning Journey Welcome to my Python learning series! As a finance professional exploring programming, I’m documenting my entire journey through 17 posts that take you from absolute beginner to building practical applications. What to Expect from This Series This series is designed for fellow finance professionals and beginners who want to learn Python in a practical, step-by-step manner. Each post builds on previous concepts while introducing new skills. ...