Skip to content

Instantly share code, notes, and snippets.

@kmcallister
Created February 13, 2022 20:09
Show Gist options
  • Save kmcallister/e90f967ff800a5dabb3b3f9d84476bbc to your computer and use it in GitHub Desktop.
Save kmcallister/e90f967ff800a5dabb3b3f9d84476bbc to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import sys
temps = sys.argv[1:]
for ln in sys.stdin:
if ln.rstrip() == 'M600':
sys.stdout.write('M104 S' + temps.pop(0) + '\n')
else:
sys.stdout.write(ln)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment