|
|
|
@ -14,7 +14,7 @@ from io import BytesIO
|
|
|
|
|
|
|
|
|
|
def main(source_file):
|
|
|
|
|
# Read the entire G-code file into memory
|
|
|
|
|
with open(source_file, "r") as f:
|
|
|
|
|
with open(source_file, "r", encoding='utf-8') as f:
|
|
|
|
|
lines = f.readlines()
|
|
|
|
|
|
|
|
|
|
# Remove any empty lines and lines that are just a semicolon
|
|
|
|
@ -122,7 +122,7 @@ def main(source_file):
|
|
|
|
|
lines = [line for line in lines if line.strip() and not line.startswith('; generated by PrusaSlicer')]
|
|
|
|
|
|
|
|
|
|
# Write the modified content back to the original file
|
|
|
|
|
with open(source_file, "w") as f:
|
|
|
|
|
with open(source_file, "w", encoding='utf-8') as f:
|
|
|
|
|
f.writelines(lines)
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|