Trigger when sending a particular Gcode command
I would like to ask if it is possible to read (let say from an algorithm in python) the Gcode commands that the printer is receiving in real time (with real time I mean the printing procedure).
In general I want to have a ‘trigger’ in particular commands in my Gcode(as when changing a layer) and with that trigger I want my python script to do something.
Is it possible?
Thank you in advance.