How Python Can Simplify Life for An IT Technician
Imagine pressing a button—and having the machine tell you what’s wrong.
CPU stats? Disk usage? Malware scans? All pretty much auto-triggered.
Even Event Logs filtered, errors highlighted..
And not to mention – check if backups running quietly in the background? Etc
The list is endless…
As a Computer Technician, we have always dreamt of something like this, that pretty much gets the job done!
Welcome to the magic of Python!
🐍 Python: Not Just for “Developers”
It’s for anyone who’s sick of doing the same repetitive thing over and over again.
We as Level 1, 2 and 3 support techs fielding 40 tickets a day – this is the perfect tool or us!
Why Python Just Makes Sense for IT Work
- Simple syntax. It reads like English. Seriously.
- Endless libraries. Need to check system stats? Backup a folder? Easy. Scrape logs? Automate a shutdown? It’s all one line away.
- Cross-platform. Windows, macOS, Linux you name it —Python runs everywhere.
We’ve even started using Python to automate my home via Home Assistant. Lights, sensors, switches.
And yes, we are considering offering home automation as a service. Big demand. Big $$.
Here’s what we normally use to diagnose PCs and Laptops:
- ⚙️ Diagnose Systems
Just run this instead of right-clicking through Task Manager, Resource Monitor, and Device Manager?
python
CopyEdit
import psutil
def system_check():
print(f”CPU Usage: {psutil.cpu_percent()}%”)
print(f”Memory Available: {psutil.virtual_memory().available / 1e6:.2f} MB”)
print(f”Disk Usage: {psutil.disk_usage(‘/’).percent}%”)
system_check()
You now know if the user’s problem is a faulty RAM or an unknown background process!
- 🦠 Trigger a Malware Scan
Let Python handle it.
python
CopyEdit
import os
def scan_for_malware():
os.system(“clamscan -r /your/directory/path”)
scan_for_malware()
- 💾 Automate Backups
Users never back up. You know it. We know it.
So just do it for them, using this script:
python
CopyEdit
import shutil
def create_backup(source, destination):
shutil.copytree(source, destination)
print(f”Backup from {source} to {destination} completed.”)
create_backup(“/source/folder”, “/destination/folder”)
- 📜 Parse Critical Windows Event Logs Without Losing Your Mind
We hate reading Event Viewer logs – its tedius – instead – we run this:
python
CopyEdit
import win32evtlog
import datetime
def read_critical_event_logs(server=None, log_type=”System”, start_time=None, end_time=None):
try:
handle = win32evtlog.OpenEventLog(server, log_type)
flags = win32evtlog.EVENTLOG_BACKWARDS_READ | win32evtlog.EVENTLOG_SEQUENTIAL_READ
print(f”Critical Events in {log_type} log:\n”)
while True:
records = win32evtlog.ReadEventLog(handle, flags, 0)
if not records:
break
for record in records:
if record.EventType != win32evtlog.EVENTLOG_ERROR_TYPE:
continue
event_time = record.TimeGenerated.Format()
event_datetime = datetime.datetime.strptime(event_time, “%Y-%m-%d %H:%M:%S”)
if (start_time and event_datetime < start_time) or (end_time and event_datetime > end_time):
continue
print(f”Time: {event_time}”)
print(f”Event ID: {record.EventID}”)
print(f”Source: {record.SourceName}”)
print(f”Category: {record.EventCategory}”)
print(f”Message: {record.StringInserts}”)
print(“-” * 50)
win32evtlog.CloseEventLog(handle)
except Exception as e:
print(f”Error reading event logs: {e}”)
# Example usage
if __name__ == “__main__”:
read_critical_event_logs(
server=None,
log_type=”System”,
start_time=datetime.datetime(2025, 1, 1),
end_time=datetime.datetime(2025, 1, 8)
)
It pretty much highlights all the red alerts!
🛠️ How to Start
- Install Python
Go to python.org. Click download. - Copy. Paste. Modify.
We use community scripts and tweak them to our liking / needs.
Final Thoughts: Work Smarter, Not Harder
As a Computer Engineer : you’re already smart. You’re already technical.
Python just multiplies your impact.
Whether you’re doing break-fix support, consulting, running remote jobs —this is the tool.
Have PC issues?
Call Us on 0484 357 559. We’ll fix it, script it, or automate it 🙂