newpage - mgaitan/waliki GitHub Wiki

A simple way to ensure all subdirectories exist:

def ensure_dirs_exists(filenames):
        subdirs = {os.path.dirname(s) for s in filenames}
        subdirs = [ s for s in subdirs if s != '' ]
        subdirs.sort(key=len)
for s in subdirs:
                if not os.path.exists(s):
                        os.mkdir(s)

How about some non ascii string like 'buen día ñoño !'

Oh, ^ looks good.

Test.

⚠️ **GitHub.com Fallback** ⚠️