Forum Archive

How to get rid of Examples folder and contents?

upwart

As I use the Pythonista Documents folder as a shared folder with a Windows folder (via Synchronator), I would like to have the Examples folder in a subdirectory. But, when I remove the Example folder at the top level, it appears again when I restart Pythonista.
Is there a way to permanently delete the Examples folders from the top level?

dgelessus

Can confirm - if I rename my "Examples" folder, a new one appears when I restart Pythonista. I don't think this is supposed to happen, after all there is a "Restore Examples" option in the Pythonista settings.

upwart

I have found a work around, by putting a pythonista_startup.py script in site-packages, which just deletes the Examples folder.:

import shutil,os
try:
shutil.rmtree(os.path.expanduser('~/Documents')+'/Examples')
except:
pass

Not very elegant, but it does the job.

omz

This behavior is intentional, but I might need to rethink it.

zrzka

@omz I vote to change the behavior. When I delete content of the Examples folder, but keep the folder itself, examples are not restored and I still have empty Examples folder. Basically Pythonista forces me to keep this folder, even empty one. I understand that you do want to reserve this folder for examples probably, but it's little bit weird. I would auto restore examples only if ExamplesVersion from user defaults differs -> updated/new examples with Pythonista update. Just my $.02. Anyway, not a big issue :)

omz

@zrzka Agreed.