Running python script in continuous print bed clearing script

basically my buddy has written a python script for me, that i want to use to make a servo with an arm clear the parts off of the print bed when it reaches a certain temp.....
sooooo.
print bed reaches 25 degrees, then the print bed goes all the way to the front........
then somehow in the gcode it calls in the python script, which runs the script and moves the servo with arm and clears all the prints off the bed, then the arm swings back to the home position and the servo turns off then the python script ends and the printer homes again ready for the next print....

my issue is im not good with gcode or python (my buddy wrote the python script for me) and i have no idea the commands needed to start the python script once the print bed reaches a certain temp.

can anyone help me, id really appreciate it :slight_smile:

You could probably use this plugin to run your script

and for the gcode you could use something like

M190 R25
G1 X0 Y200.0
M400

and then the action command you configured in the plugin

This would require M118/host_action_commands. Might work with gcode system commands plugin without that requirement.