Rewriting gcodepreview with Python

Managed to puzzle out the DXF issue:

and have found something which one needs to be aware of when working w/ PythonSCAD/PythonOpenSCAD — the .py files are compiled to .pyc files in a hidden folder, so:

“C:\Users\willa\OneDrive\Documents\GitHub\gcodepreview\gcodepreview.py”

generates:

“C:\Users\willa\OneDrive\Documents\GitHub\gcodepreview_pycache_\gcodepreview.cpython-311.pyc”

Since the .py files are now being generated from a Literate Program:

that .py file was not being seen by PythonSCAD to be evaluated/recompiled save when called — which generated errors where a module was undefined, since apparently while in the .py file, the .pyc file had not been updated to match.

1 Like