返回包含目录中文件名称的列表。 path可以指定为str或bytes。 如果path是bytes, 返回的文件名也将是字节; 在所有其他情况下 返回的文件名将是str。 如果path为None,则使用path ='.'。 在某些平台上,路径也可以指定为打开的文件描述符; \ 文件描述符必须引用目录。 如果此功能不可用,则使用它会引发NotImplementedError。 该列表按任意顺序排列。 它不包括特殊 条目'。' 和'..'即使它们存在于目录中。 Return a list containing the names of the files in the directory. path can be specified as either str or bytes. If path is bytes, the filenames returned will also be bytes; in all other circumstances the filenames returned will be str. If path is None, uses the path='.'. On some platforms, path may also be specified as an open file descriptor;\ the file descriptor must refer to a directory. If this functionality is unavailable, using it raises NotImplementedError. The list is in arbitrary order. It does not include the special entries '.' and '..' even if they are present in the directory. """
os.listdir('.')
最新推荐文章于 2024-07-29 14:30:35 发布