a python script to postprocess gcode with dynamic Z movements