def create_local_temp_dir(name, directory=None):
"""
Create a directory for storing temporary files needed for testing neo
If directory is None or not specified, automatically create the directory
in {tempdir}/files_for_testing_neo on linux/unix/mac or
{tempdir}\files_for_testing_neo on windows, where {tempdir} is the system
temporary directory returned by tempfile.gettempdir().
"""
if directory is None:
directory = os.path.join(tempfile.gettempdir(),
'files_for_testing_neo')
if not os.path.exists(directory):
os.mkdir(directory)
directory = os.path.join(directory, name)
if not os.path.exists(directory):
os.mkdir(directory)
return directory
评论列表
文章目录