I’ve just rewritten the image cleaner in my image scraper notebook (it was poop) and I have a couple of quick take-aways for you.

1) You should be using pathlib instead of os for file/folder path shenanigans. It’s so much easier to code and your code is so much easier to read. If you’re new to python and you’re using os and glob and shutil and whatever else, go and learn pathlib now.

2) ipywidgets are still great and I’m still a big fan, but it turns out that creating new widgets is about 10x slower than updating existing ones. Since you anyway tend to end up with functions which generate your UI, it’s tempting to render new widgets when you need to redraw the UI by just calling the function(s) again. Don’t. It probably also goes against what you’ve been taught to have lots of global variables laying around containing UI values and containers etc. Do it anyway.