Hi,
Script checks if target directory exists, but it does not check permission.
Maybe something like this could do the job?
(found here: https://stackoverflow.com/a/2113511/1215291 )
os.access('/path/to/folder', os.W_OK)
Thanks for sharing your script. It is pretty useful for learning Python. I'm tired of doing such things in pure bash :)