Hi,
Mach4 doesn't use Python but it does use Lua and can be used to generate motion.
I did a script a while back for a guy who wanted to do some 'pearling', which consists of circular brush marks in a regular pattern
on a metallic surface, quite attractive really.
Rather than use pound variables I used registers because registers are assigned names and therefore easier to use.....for example
'Step_Over ' verses #105. I had a Lua panel that accepted the various numeric constants necessary to generate the required pattern,
the start and end locations etc, and thereafter the script generated Gcode commands.
Lua scripts have all the usual conditional constructs like Do While, and all the regular functions of a programming language, very much
more comprehensive than Fanuc MacroB.
You could call it a 'canned cycle'. All very interesting but I'm dubious that it is a good teaching strategy, its more about Lua, Mach4's internal structure
and its API, as I say all very interesting but only peripherally related to Gcode.
Craig