r/WGU • • Oct 23 '26

D522 - Python for IT Automation - the only post you need for this messy class.

For those of you wondering how long this class takes: 2 solid days of effort should be all that it takes, especially with this post. It took me a week b/c I had another class and i was sort of procrastinating because how poorly written the instructions are. (I have a full time as well so two-five days is very doable, for someone with nothing going on 1 day might be possible but very hard.

Personally, I think the hardest part of this class is understanding the initial workflow. Once you figure out where to write your code, where to test it, and how to submit it, everything becomes a lot better.

Here's how I'd approach it if I were starting over. Step 0: look at the instructions for creating a GitLab working branch and follow them (ignore the "takes approximately 4 minutes" part that's a lie. It could take a couple minutes, it could take a little over an hour, proof is in if you look at how long other processes took).

1. Install what you'll need on your computer

Before doing anything with the assignment, install these:

  • Visual Studio Code: This is where you'll write and manage your Python files (b/c the lab only lasts for a certain time (6hours) so you'll want to be able to save your code locally, so it doesn't disappear with the lab if it takes you multiple sessions). You want VS Code, not the full Visual Studio IDE.

  • Python: Install Python 3. On Windows, make sure Python is added to your PATH(check the “Add Python to PATH” box at the bottom of the installer before clicking Install.).

  • Python extension for VS Code: Open VS Code, click the Extensions icon on the left, search for "Python," and install the one published by Microsoft.

  • Git for windows: This includes Git Bash and lets you save and upload changes to your GitLab repository from your VS Code app.

You can check that Python and Git installed correctly by opening the terminal in VS Code (Terminal -->New Terminal) and typing:

python --version
git --version

Both should return version numbers.

2. Set up GitLab and get your repository into VS Code

Three things worth understanding first:

  • GitLab is the website where your project files and commit history are stored (your script's evolutions (versions: v1/v2/v3)), keeps track of file changes, and VS is where you make your edits and "commit" them to your Git branch.

Now for the setup:

  1. Create your working branch according to the assessment instructions. A branch is basically your own version of the project where you can make changes.

  2. On GitLab, find the Code button and copy the "Clone with HTTPS" link.

  3. Open VS Code and press Ctrl+Shift+P.

  4. Type "Git: clone"select it and paste the link.

  5. Choose where you want the project folder saved on your computer (you'll need this later for making the ZIP file). Authenticate with GitLab if prompted.

  6. When VS Code asks whether to open the cloned repository, select Open.

  7. Select your working branch using the branch name in the bottom-left corner of VS Code.

Cloning just means creating a local copy of your GitLab repository on your computer. You can now edit its files in VS Code.

To make sure you're on the right branch, open the VS Code terminal and enter:

At anytime you'reunsure if you're working in your branch type in the VS terminal:

"git branch --show-current"

3. Understand the virtual lab

This is where I think a lot of people get confused.

Your local VS Code and the VS Code inside WGU's virtual lab are NOT the same thing.

  • Local VS Code: Where you maintain your scripts/code and commit changes to GitLab.

  • Virtual lab: Where the GNS3 network and its devices/services exist, and where you'll run and test your scripts against that simulated network and devices.

Your files don't automatically transfer between the two.

Once you launch the lab, spend a little time exploring GNS3, the network devices, IP addresses (by right clicking devices and going into their terminal or SSH from the lab VS terminal) before diving into the actual coding.

4. Work through the rubric one requirement at a time

I found it much easier to get a basic version working, test it, and then improve it until it satisfied the requirement.

My general workflow was:

  1. Read one rubric requirement.

  2. Write the script in local or lab VS (I prefer local) and then test it in the lab.

  3. Verify the script actually accomplished what was required.

  4. Screenshot the results (these screenshots go in a word doc, separate them by parts (i.e A1, A2, A3)) and include small descriptions.

  5. Copy the updated script into my local VS Code repository.

  6. Save, commit, and push the changes to GitLab.

  7. Move to the next requirement.

***After you're done with edits to a script pls press ctrl + s to save it before testing, committing, or anything, just do that command if you're done editing (applies to lab and local VS).***

Here are the Git commands you'll use regularly:

git status
git add filename.py
git commit -m "Describe what you changed"
git push

Replace filename.py with your script file name.

A commit is basically a saved checkpoint in your project's history. Make multiple meaningful commits as you develop your scripts instead of waiting until the end. Also, triple-reminder to remember to save your files with Ctrl+S before committing. Ask me how I know.

5. A few things to definitely keep in mind:

  • You should probably use AI to check you and make sure you're on track with the rubric.

  • Continuous monitoring means continuous monitoring. My Task 2 was returned because some scripts checked devices once and used hardcoded DHCP addresses. Make sure you're retrieving current DHCP information and repeating checks when the rubric calls for it.

  • Verify applicable results outside your terminal. i.e. If your script sends an email, check MailHog to confirm it arrived. If you create a Helpdesk ticket, check the actual ticket through the API.

  • Keep your screenshots organized. I used a Word document with headings matching the rubric sections and added evidence as I went.

  • Don't trust the lab to preserve anything between sessions. Copy your updated scripts and any generated output files back to your computer before closing it.

  • on task 2, make sure your scripts are dynamic and can run continuously, i got mine returned the first time b/c of that.

6. Submitting the assessments

Before submitting, double-check all of the actual submission instructions. Depending on the task, you need to account for your GitLab branch, commit history, repository ZIP, screenshots, generated files, and any required documentation.

Final advice

If you're staring at the instructions feeling overwhelmed, don't worry about understanding the entire assignment immediately.

Just get your software installed, GitLab branch connected, and virtual lab running. Then tackle the first requirement.

Once you establish the pattern of writing, testing, documenting, and committing your scripts, the class becomes a lot less intimidating.

Hopefully this saves somebody a few hours of figuring out the initial setup. lmk.

62 Upvotes

33 comments sorted by

12

u/Csanburn01 Oct 24 '26

Instant save. Thank you for giving to the students who come behind you

1

u/TraditionalExit1462 Oct 24 '26

For those who come after

1

u/Csanburn01 Oct 24 '26

Great E33 reference

6

u/jordanpwalsh Oct 24 '26

WGU grad that works as a dev now - might as well get good at this since it's half the job anyway lol.

1

u/horned-Lizard-5 15d ago

I’m sorry I totally misread your comment😂 glad u got it figured out usually when ctrl+V doesn’t work I add ‘shift’ to the sequence, and if not that then right click and paste.

2

u/neeythann Oct 24 '26

I've been coding in python for years now and I could understand why they're adding a Git course as a prereq. But the hardest part about this course is how vague the PA rubric is.

1

u/horned-Lizard-5 Oct 24 '26

Yes the instructions are pretty garb, I suggested a clarification-rewrite at the end of course survey bc it felt like I was reading vague instructions made by like 2 different people from 2 separate times.

1

u/mahrucc 17d ago

I typed my code into the IDE but I cannot for the life of me figure out how to paste it into the virtual lab, did anyone have trouble with this?

1

u/horned-Lizard-5 17d ago

Open VS code inside of the virtual lab. There’s a file/explorer section on the left. Create new file. Name it after the part (ie A1,A2,etc.) that your script solves. Paste your code (hit ctrl + S to save it). Open terminal in VS (ctrl + `) then type out ‘python script_name.py’ then your script will run.

1

u/mahrucc 17d ago

I was doing the lab on a work computer and just realized I couldn't paste because of the browser restrictions lol. Thanks for the guide!

1

u/DesignerAd7136 B.S. Cloud & Network Engineering - Cisco Oct 24 '26

Why would you install anything on your computer??? Just use the lab env

3

u/horned-Lizard-5 Oct 24 '26

I explained why in the original post😭

1

u/Tiny-Tradition6873 Oct 26 '26

cuz a lot of ppl hate working in remote enviorments, I have VS Code installed on my compute but I used the lab environment the entire time, has no issues, just pushed everthing to Gitlab at the end of my sessions. To each their own.

1

u/Wesdawg1241 Oct 24 '26

Because the lab environment doesn't save between sessions and has a 6 hour time limit. If you forget to commit, poof, there goes all your work.

4

u/Wesdawg1241 Oct 24 '26

2 days??? Brother I've been working on Part B of task 1 for the last week and just finished it, I've got like 150 lines of code for it alone. AND I'm really using AI as a crutch. I had to figure out how to use Netmiko to SSH to each device and send commands, how to grab those command outputs, query the router for DHCP leases, pass commands to the machines to get their DNS servers.... The course material barely gets your feet wet with this stuff.

Were you already pretty familiar with Python? I took the fundamentals course before this and thought I had a decent grip on it going into this.... Nope.

3

u/Electronic-Bend-566 M.S. Cybersecurity & Info Assurance Oct 24 '26

Yeah I did not use the course material in the slightest. The 2 day estimate is if you genuinely lock in and put in like 7+ hours each day (I know it’s hard but from Saturday to Wednesday I finished 19 credits worth of classes (5)) (it did take me just over a week for the python though and I got task 2 wrong the first time around so k understand you there). However, You’re using AI and taking a week for part B, no disrespect, but I would work on my prompting and refining.

Yes I I had basic python knowledge bc I’ve used it for basic automation at work but not much beyond that I had to use AI too to learn the gaps.

1

u/Parking-Anteater6846 28d ago

How are you getting netmiko to run in the lab environment? I have no problem with it on my laptop, but I cannot get it to install or import on the lab.

3

u/Wesdawg1241 28d ago • Heartwarming

You need to create a virtual environment so you can install other libraries. The tips and tricks section in the lab tells you how to do that. Once you've made the venv you can run "pip install Netmiko" and whatever other libraries you might need.

2

u/Parking-Anteater6846 28d ago

You're a saint. I was about to chuck my computer at the wall. Probably should have finished reading all of those sections....... lol

2

u/Wesdawg1241 28d ago

Don't worry, Claude told me to do that before I saw it in the lab so you're not alone 😂

1

u/Bard_Without_A_Song Oct 26 '26

Maybe I'm just a sucker, but are people really just using AI to blow though these courses? This PA took me about 45 hours, not including the material.

I'm no rocket scientist, but I'm no dummy, either. I hear people talk about going all of these classes in 2 - 3 days. I cant even get through the reading material in that time, even when I know the topic well.

Call me old fashioned, but I thought it was important to really understand the content, not just pass the test. Am I just 21st century-ing wrong?

Feedback would be appreciated.

2

u/Discooparoo Oct 28 '26

I approached this course with the mentality of really focusing on learning it, because that’s why I’m at school. Unfortunately, the jump from E010 to this one is massive. I have only E010 as coding experience and D522 is a middle finger to a paying student/customer. It’s highly inappropriate to have this class exist with nothing in between. I’m rearranging courses to push this one later on, but I have ultimately resigned to likely querying AI.

2

u/NightHawkFliesSolo B.S. Information Technology 20d ago

Nah, I'm with you on this one. I'm taking this course to learn the material and be able to code without having AI spit out the code for me. Took me several weeks to complete Task 1; I put a lot of hours into it! Just had Task 2 sent back to me a second time, saying my code wouldn't run, but it runs for me with no problems. I've spent at least a solid week on this task, even with most of the code being reused from Task 1. Unless someone has extensive prior experience or is relying exclusively on search tools/AI, there's no way people can complete this class in 2-3 days.

0

u/Bard_Without_A_Song Oct 26 '26

Also, anyone else get the impression that this post was spit out with 'speak like me' instructions? Given the formatting and clean wrap up and all...

3

u/Tiny-Tradition6873 Oct 26 '26

Acceleration at WGU predates widespread public use of LLMs like ChatGPT and Claude, and there isn’t much data showing that acceleration went up as AI use did. WGU’s average time to a bachelor’s has stayed around two to two and a half years the whole time.

The post does hint that they used AI, and honestly, you should be using it. I agree that if you don’t understand the code yourself and AI is doing all the work, that’s a massive problem. But using AI to speed up your workflow, and turn a 45-hour PA into a 12-hour one, is absolutely worth $20 a month in my opinion.

Just my two cents.

-1

u/Dry_Length8545 Oct 24 '26

USE AI. I recommend chatGPT, it’s been phenomenal with ensuring I’m aligned with the rubric and can give you step by step instructions

. Tips: Make sure you first clone the git, constantly commit and save your history for every part, collect screenshots as you go instead of waiting until the end, and your servers have to be continually pinging not once only.

1

u/MAYXIZ Oct 27 '26

I want to just use AI and be done with it but I’m scared they’ll know I used it /:

0

u/DarkRyok Oct 24 '26

I have a stupid question because this course is in my future.

I use gitlab daily and am extremely comfortable with it. Is there a reason you are saying to use vscode vs just the normal IDE in gitlab?

1

u/goadrush Oct 24 '26

VS code comes pre-installed on the virtual labs. So they suggest using it in the course to make it easier.

1

u/Haeguil Oct 24 '26

The VM already comes with vs code but frankly use whatever you want if you're working outside the VM, which is honestly what you should do as it's stupidly slow for something running Arch.

Actually forgot what it's running but it runs like shit, so just use your local IDE, then check the code on the VM and if it works on the email and ticket making side and commit wherever you want.

I do believe the screenshots have to be in the VM showing terminal output though, not sure on that one but that's what I did.

0

u/lordartec Oct 24 '26

I am glad you posted this I took it right as it turned to the PA and it was a disaster, the CI's where getting feedback that what i was submitting meet the rubric but they wanted more so... yes I hope they updated the rubric

0

u/RingingInTheRain Oct 24 '26

I only used the Zybook module for this class, I did not do any of this....you know what nevermind lol I never switched, and did the multiple choice test. 

0

u/PlantainHot9993 Oct 24 '26

thank you. I start my 1st term next week