Skip to content

Instantly share code, notes, and snippets.

View howardjones's full-sized avatar

Howard Jones howardjones

  • United Kingdom
View GitHub Profile
@howardjones
howardjones / extract.py
Last active November 16, 2021 21:41
extract the cura settings from a gcode file
import json
import ast
from codecs import encode, decode
with open("CFFFP_Drawer_ThinHandle_TOLERANT.gcode", "r", encoding="utf-8") as f:
settings_lines = [
line.strip()[11:] for line in f.readlines() if line.startswith(";SETTING_3 ")
]
data = json.loads("".join(settings_lines))