|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 胖大昕 于 2019-10-26 12:57 编辑
各位大神帮我看看
>>> os.remove('/Users/tangxin/Documents/A/aa/1/1.docx')
>>> os.rmdir('/Users/tangxin/Documents/A/aa/1')
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
os.rmdir('/Users/tangxin/Documents/A/aa/1')
OSError: [Errno 66] Directory not empty: '/Users/tangxin/Documents/A/aa/1'
胖大昕 发表于 2019-10-26 13:15
>>> list(os.walk('/Users/tangxin/Documents/A/aa/1'))
[('/Users/tangxin/Documents/A/aa/1', [], ['. ...
先执行 os.remove('/Users/tangxin/Documents/A/aa/1/.DS_Store') 再试一试删除:os.rmdir('/Users/tangxin/Documents/A/aa/1')
|
|