A beginner repo where I'm learning Python by building small network tools. Started October 2026. Everything here is written, run, and debugged by me on my own PC.
pingcheck.py pings a list of addresses and reports whether each one replied (UP) or not (DOWN). It checks four things:
| Address | What it tests |
|---|---|
127.0.0.1 |
Loopback: my PC's own network software |
192.168.1.1 |
My router: the local network (LAN) |
8.8.8.8 |
A raw internet IP: can traffic leave my network? |
google.com |
A name: does DNS translate it to a number? |
Reading the results in order shows where a connection breaks: my PC, my local network, or the internet. If the raw IP works but the name fails, that points to a DNS problem. Computers route traffic with numbers (four octets, like 8.8.8.8), and DNS is the translator that turns human-friendly names into those numbers.
I also keep a known-bad address (10.255.255.1) as a control during testing. When it correctly reports DOWN, I know the script can actually detect a failure.
subprocess.run(["ping", "-n", "1", ip])runs the Windows ping command once per address.result.returncode == 0means the device replied. Any other value means it didn't.- A
forloop repeats the check for every address in thedeviceslist.
python pingcheck.pyExpected output on a healthy network:
127.0.0.1 is UP
192.168.1.1 is UP
8.8.8.8 is UP
google.com is UP
Real coding is mostly fixing broken code, so I practiced on purpose. The files in debugging-log/ are broken scripts I fixed by reading the error messages. Each challenge has the original broken file and the fixed version next to it.
| Files | Errors | What it taught me |
|---|---|---|
broken.py / broken_fixed.py |
Missing bracket, missing colon, missing indent | Python uses brackets, colons, and indentation to know what belongs where. Quotes mean plain text; no quotes means a variable. |
broken2.py / broken2_fixed.py |
IndentationError, then three TabErrors, plus = vs == |
Tabs and spaces look the same but Python treats them differently, so use spaces only. = stores a value; == asks a question. |
| First successful run | ![]() |
Debugging broken2.py (error to fix) |
![]() |
| Four-address check, all UP | ![]() |
| Final script | ![]() |
- The script prints DOWN for any failure, so it can't say why something failed.
- Ping can't tell whether my IP came from DHCP or was set manually. That needs
ipconfig /all.
- Add a counter:
2 of 4 devices are UP - Test a fake name (
notarealsite12345.com) to see what a DNS-style failure looks like - Read the device list from a text file instead of typing it in the code
- Move from Notepad to VS Code



