|

Python for QA Testing: The Complete Setup Guide

Remember when you were a kid learning to ride a bike? That mix of excitement and terror as your parent held the back of your seat, promising they wouldn’t let go (spoiler: they always did). That’s exactly how I felt setting up Python for the first time.

Welcome back to my “Learn Python With Me” series! I’m Nicole, your fellow QA tester who’s learning Python right alongside you. Last time, we talked about why Python makes sense for us QA folks. Today, we’re going to talk about getting set up and taking our very first baby steps with actual Python.

Setting Up Python: The “I Promise It Won’t Explode” Guide

When I first decided to install Python, I had this irrational fear that I’d somehow break my entire computer. Good news: I didn’t, and you won’t either!

Step 1: Downloading Python

First, you’ll need to download Python from the official website: python.org

Look for the big yellow “Download Python” button. It should detect your operating system and offer the right version automatically.

My Learning Moment: Make sure you’re downloading from the official site. There are some sketchy sites out there that might give you Python…with a side of malware. No thank you!

Step 2: The Installation That Actually Worked

Here’s what I did:

  1. Run the installer file you downloaded
  2. Check the box that says “Add Python to PATH” (THIS IS SUPER IMPORTANT!)
  3. Click “Install Now”

My Learning Moment: I missed checking that “Add Python to PATH” box the first time around. Cue three hours of Googling “why doesn’t Python work” and questioning all my life choices. Learn from my mistake!

Step 3: Checking If It Worked

To see if Python installed correctly:

  • On Windows: Open Command Prompt (search for “cmd” in your start menu)
  • On Mac: Open Terminal (it’s in your Applications > Utilities folder)

Then type:

python --version

If you see something like Python 3.13.3, congratulations! You’ve successfully installed Python without breaking anything!

My Learning Moment: If you see “Python is not recognized,” don’t panic! I’ve been there. It usually means Python isn’t in your PATH. You can either reinstall and check that magic box, or Google “add Python to PATH manually” for your specific operating system.

Where Do We Actually Write Python Code?

This was my next big question. Where do Python programmers actually write their magical code spells?

Option 1: IDLE (Comes with Python)

When you installed Python, it came with a simple program called IDLE. It’s like Notepad, but specifically for Python.

To find it:

  • On Windows: Search for “IDLE” in your start menu
  • On Mac: Look in your Applications folder

My Learning Moment: IDLE is great for simple scripts, but I quickly outgrew it. That’s normal!

Option 2: VS Code or Pycharm (What I Use Now)

After a week with IDLE, I switched to more powerful tools. There are two popular options that most professional developers use:

Visual Studio Code (VS Code):

  • Free and lightweight
  • Great for beginners
  • Download it from code.visualstudio.com
  • Install the Python extension (look for the extensions icon on the left sidebar)

PyCharm:

  • Specifically designed for Python
  • Has a free Community Edition
  • More Python-specific features out of the box
  • Download from jetbrains.com/pycharm – Make sure to download the Community Version – It’s free!

My Learning Moment: Both these tools felt overwhelming at first with all their buttons and options. I just ignored 90% of them to start, and it worked out fine! I actually switch between VS Code and PyCharm depending on what I’m working on – VS Code for quick scripts and PyCharm for more complex projects. Don’t worry about choosing the “perfect” tool – many professionals use both!

I choose based on my mood.

Python Syntax: The “It’s Actually Just English But Pickier” Guide

Now for the fun part – actually writing some Python! Let me share the basic rules that helped me get started without feeling completely lost.

Rule #1: Python Is Super Literal

Python does exactly what you tell it to do – not what you meant to tell it to do. It’s like that friend who follows your directions to your house with GPS precision, even when you accidentally send them to the wrong state.

My Learning Moment: If your code doesn’t work, there’s a 99% chance you spelled something wrong, forgot a symbol, or added an extra space where it doesn’t belong.

Rule #2: The Colon and Indentation Dance

In many programming languages, you use curly braces {} to group code together. Python said “nah” to that and uses colons and indentation instead.

Example:

if test_passed:
print("Yay!")
print("The test worked!")

See how the lines after if test_passed: are indented? That indentation matters A LOT in Python.

My Learning Moment: I kept forgetting the colon at first. Then I’d forget to indent the next line. Python would get mad at me. We’re friends now though.

Rule #3: Symbols Mean Different Things

Some symbols in Python might not mean what you expect:

  • = means “assign this value” (not “equals”)
  • == means “is equal to?” (for comparisons)
  • + can add numbers OR join strings together
  • # starts a comment (Python ignores everything after it)

My Learning Moment: I kept using = when I meant == in my first week. This led to many confused staring contests with my computer.

My First “Actual” Python Code

Let’s write something super simple together – like, ridiculously simple, but it’s a start!

When I first got this working, I felt like I had just summited Mount Everest. In reality, it was more like I’d climbed the stairs in my house – but hey, progress is progress!

Errors I’ve Already Made So You Don’t Have To

In just my first week with Python, I’ve already collected some face-palm worthy errors:

The Great String vs. Number Confusion

I tried this:

print("Tests run: " + 5)

Python’s response was basically: “Excuse me, what? I can’t add text and a number together.”

The fix:

print("Tests run: " + str(5))

My Learning Moment: Python is picky about mixing types. You need to convert numbers to strings using str() if you want to combine them with text.

The Infamous Indentation Error

I wrote:

if all_tests_passed:
print("Yay!")

Python threw an “IndentationError” at me.

The fix:

if all_tests_passed:
print("Yay!")

My Learning Moment: Python uses indentation to determine which code belongs to which block. It’s not just being picky – this is actually how Python knows what code goes together.

What I’ve Learned So Far (The Actually Useful Stuff)

After a week of fumbling around with Python, here’s what I’ve actually learned that feels useful:

  1. Python is forgiving – You can mess up a lot and nothing catastrophic happens
  2. Error messages are your friends – They’re like GPS directions when you’re lost
  3. Keep it simple – My best progress came when I wrote tiny, simple scripts
  4. The community is amazing – There are so many helpful resources out there

Homework: Your Turn to Experiment

Here’s a super simple challenge to try on your own:

  1. Install Python (if you haven’t already)
  2. Open IDLE or VS Code
  3. Create a new file called my_first_script.py
  4. Write a script that:
    • Creates a variable with your name
    • Creates a variable with your favorite testing tool
    • Prints a sentence using both variables

That’s it! Just getting that working is a huge first step.

Coming Up Next

In our next post, we’ll explore variables in more depth and start working with different data types. We’ll keep it practical with QA-focused examples that actually make sense for our day-to-day work.

Let’s Share Our Progress!

Have you installed Python yet? Run into any weird errors or had any “aha!” moments? Share your experience in the comments – the good, the bad, and the “why is my computer doing this?” moments.

Remember, we’re learning together. Your confusion today is probably the exact same confusion I had yesterday!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *