Change os.mkdir command to os.makedirs command to allow for recursive directory creation.