Create a directory if it doesn’t exist:

import os.path

isdir = os.path.isdir(postpath)
if not isdir:
    os.mkdir(postpath)