check if directory `directory ` exists and create it if necessary,"if (not os.path.exists(directory)):