Skip to content

Instantly share code, notes, and snippets.

@wiccy46
Created August 14, 2020 08:36
Show Gist options
  • Save wiccy46/a62b6a792d78c155cb38d060d4e897f9 to your computer and use it in GitHub Desktop.
Save wiccy46/a62b6a792d78c155cb38d060d4e897f9 to your computer and use it in GitHub Desktop.
[pythonsys]System relative snippets #python
# add one level above to path.
sys.path.insert(0, os.path.normpath(os.path.join(os.path.realpath(__file__),
'..', '..')))
# -------------------------------------
import shutil, os
shutil.rmtree(path, ignore_errors=True) # rm folder
os.makedirs(path, exist_ok=True) # mkdir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment