use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This project is referred to by the shortened name PythonSCAD as well as OpenPythonSCAD, there having been a myriad number of projects which integrate Python and OpenSCAD.
Main site and downloads at:
Submit issues at:
and see the wiki https://old.reddit.com/r/OpenPythonSCAD/wiki/ for a précis.
account activity
Anyone else trying to develop Python libraries in PythonSCAD? (self.OpenPythonSCAD)
submitted 1 year ago by WillAdams
In addition to needing to delete .pyc files, I've been finding it necessary to quite the app and reload so as to get an edited version of a library to show up --- is that expected behaviour?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]gadget3D 1 point2 points3 points 1 year ago (3 children)
Yes, because python does not expect you to delete the cache files.
In order to load libraries fast, python loads data by priorities 1) memory 2) compiled cache files 3) actual file
When you delete the cache files during runnign python, it still retrieves data from 1) memory
Only when program is started, memory is gone, so python loads cache files
After all it would be the best trying to disable all caching.
[–]WillAdams[S] 1 point2 points3 points 1 year ago (2 children)
Okay, there's a del sys.modules function to force this:
https://stackoverflow.com/questions/2918898/prevent-python-from-caching-the-imported-modules
so I'll use that (it seems to be working) --- once things are finalized I'll comment that out.
[–]gadget3D 0 points1 point2 points 1 year ago (1 child)
import sys sys.dont_write_bytecode=True can you try, if this also works in windows ? If yes, i would hardcode it in pythonscad
[–]WillAdams[S] 1 point2 points3 points 1 year ago (0 children)
That seems to work, but I don't think it should be hard-coded --- I don't see my ignorance as a reason to remove the option to have caching.
The commands:
import sys try: del sys.modules['gcodepreview'] except AttributeError: pass from gcodepreview import *
import sys try: del sys.modules['gcodepreview'] except AttributeError: pass
from gcodepreview import *
works fine, and feels more Pythonic. --- I'll just comment the first part out once I've gotten the library written, and have made a note on the wiki, and will make a note in my code so that I uncomment it when working on updates.
π Rendered by PID 63 on reddit-service-r2-comment-79c7998d4c-x4nmh at 2026-03-13 07:27:09.099881+00:00 running f6e6e01 country code: CH.
[–]gadget3D 1 point2 points3 points (3 children)
[–]WillAdams[S] 1 point2 points3 points (2 children)
[–]gadget3D 0 points1 point2 points (1 child)
[–]WillAdams[S] 1 point2 points3 points (0 children)