实例
以下实例演示了 walk() 方法的使用:
#!/usr/bin/python # -*- coding: UTF-8 -*- import os for root, dirs, files in os.walk(".", topdown=False): for name in files: print(os.path.join(root, name)) for name in dirs: print(os.path.join(root, name))
2024-04-05 12:40:24
以下实例演示了 walk() 方法的使用:
#!/usr/bin/python # -*- coding: UTF-8 -*- import os for root, dirs, files in os.walk(".", topdown=False): for name in files: print(os.path.join(root, name)) for name in dirs: print(os.path.join(root, name))
下一篇:6-1首页和登陆页面的配置