Created
August 17, 2021 02:05
-
-
Save alexqzd/8f4b8fe1f35fe10884f436d5c8ddc2ca to your computer and use it in GitHub Desktop.
PrusaSlicer post-processing script to show on the LCD screen which type of feature is currently being printed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import sys | |
| import re | |
| import os | |
| import sys | |
| sourceFile = sys.argv[1] | |
| # Read the ENTIRE g-code file into memory | |
| with open(sourceFile, "r") as f: | |
| lines = f.read() | |
| type_expresion = r'(;TYPE:(.*))' | |
| lines = re.sub(type_expresion, r"\1\nM117 Printing: \2", lines) | |
| with open(sourceFile, "w") as of: | |
| of.write(lines) | |
| of.close() | |
| f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment