Python os模块

一、a = os.popen("dir").read()

执行系统命令dir并且存放在a中

二、os.stat("README.md")(查看文件状态)

  os.stat_result(st_mode=33206, st_ino=1125899906884440, st_dev=1418820656, st_nlink=1, st_uid=0, st_gid=0, st_size=7, st_atime=1515852756, st_mtime=1515852756, st_ctime=1515852756)

三、os.path.isfile("README.md")(判断是否是文件)

  True
原文地址:https://www.cnblogs.com/Presley-lpc/p/9398448.html