If you're a manufacturing engineer thinking about learning to code, the worst thing you can do is start with a generic "Learn Python" course. You'll spend three weeks on binary trees and sorting algorithms and never once touch anything that helps you at work. I've made the case elsewhere that you don't need to become a software engineer — you just need to stop doing the same five minutes of clicking every morning. This post is the how.
The shop floor uses a surprisingly small slice of Python. Learn this slice deeply and you'll cover the overwhelming majority of real automation you'll ever write.
The five things that cover 80% of shop-floor Python
- 1Read and write Excel —
openpyxlandpandas. The shop runs on spreadsheets; automating them is the highest-leverage skill you can learn. - 2Wrangle files — CSV logs, PDF setup sheets, folders full of programs.
pandas,pathlib, and a PDF library go a long way. - 3Talk to machines — `pyserial` for older controls, FOCAS for FANUC. This is where you stop being a spreadsheet jockey and start being dangerous.
- 4Put a face on it — a small GUI with Tkinter or PyQt so a non-coder can actually use your tool.
- 5Ship it — package the script to a
.exeso it runs on a machine with no Python installed.
Start with a task you hate, not a tutorial
The single best predictor of whether you'll actually learn is whether you're solving a problem that annoys you today. Pick the task you dread doing every Monday. Automate exactly that. The learning attaches itself to a real problem and sticks.
A concrete first project
Here's the one I recommend: take a report you build by hand every week — a production summary, a timesheet, a setup sheet — and generate it with code. It touches Excel, files, and a bit of logic, and the payoff is immediate. The core is often this small:
from openpyxl import load_workbook
wb = load_workbook('machine_log.xlsx')
ws = wb.active
# sum runtime for every row where the machine was cutting
total = 0
for row in ws.iter_rows(min_row=2, values_only=True):
state, minutes = row[2], row[4]
if state == 'CUTTING':
total += minutes
print(f'total cutting time: {total} min')That's it. No frameworks, no cleverness. Twenty lines like this replace an afternoon of manual tallying — and once it exists, it runs in a second, every time, without transposing a number.
The environment problem nobody warns you about
Here's the thing tutorials skip: shop-floor PCs are locked down. No admin rights, sometimes no internet, an ancient Windows build. So learn early how to work inside that reality — virtual environments, offline package installs, and packaging your tool to a standalone .exe that a machinist can double-click. A brilliant script that won't run on the floor PC is worth nothing.
Where to go next
- Talk to a modern control: read machine data with FOCAS.
- Talk to an old one: pyserial over RS-232.
- See parts instead of numbers: your first OpenCV inspection.
You're not trying to become a programmer. You're trying to become the engineer who can make a problem disappear instead of filing a ticket about it.
Pick the task you hate most this week and automate it. That's the whole roadmap. If you get stuck or want to talk through a first project, reach out.


