摘要: os.path.isfile will return false if the argument is not a file: that is, it is a directory, or it does not exist. os.path.exists returns if it is a va 阅读全文
posted @ 2020-05-26 08:46 天冰老冰棍 阅读(334) 评论(0) 推荐(0)
摘要: [item for item in os.listdir('/') if os.path.isdir(item)] 返回是空,这肯定是不对的,根目录下明明有很多目录的。 原来os.path.isdir检查的目录是在当前目录下的,而不是os.listdir清单('/')下的目录下,我的目录并没有切到/ 阅读全文
posted @ 2020-05-26 08:16 天冰老冰棍 阅读(591) 评论(0) 推荐(0)