import os

def create_output_dir(dirname):
    if not os.path.isdir(dirname):
        try:
            os.mkdir(dirname)
        except OSError:
            print ("Creation of the directory '%s' failed" % dirname)
            exit()