生活在宁静的角落
  • django
  • Life
  • Linux
  • Python
  • 软件下载
  • Storage
  • 网络
  • Windows
  • Work
  • 虚拟化
  • 英语
    • Archives

python 列出文件夹下所有的文件以及文件夹名

Date 2020-06-16(Tue) By terry Category Python. Tags python
import os
path = 'D:\******……' #定义路径

folders = os.listdir(path)
for folder in folders:
    print(folder)
  • 快速访问

  • 主页
  • 分类访问

  • Linux 分类
  • Categories

  • django
  • Life
  • Linux
  • Python
  • 软件下载
  • Storage
  • 网络
  • Windows
  • Work
  • 虚拟化
  • 英语
  • Tags


© 2025 生活在宁静的角落 • 沪ICP备14021346号-3,