def delete_empty_dir(directory):
if os.path.exists(directory):<EOL><INDENT>if os.path.isdir(directory):<EOL><INDENT>for d in os.listdir(directory):<EOL><INDENT>path = os.path.join(directory, d)<EOL>if os.path.isdir(path):<EOL><INDENT>delete_empty_dir(path)<EOL><DEDENT><DEDENT><DEDENT>if not os.listdir(directory):<EOL><INDENT>os.rmdir(directory)<EOL>print("<STR_LIT>" + directory)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>
删除空目录

:param directory: 目录路径