发布时间:2019-09-23 17:06:55编辑:auto阅读(2592)
文件是否存在
os.path.exists(save_to_path+ '/0.png'):
删除
os.remove(save_to_path + '/0.png')
当前运行的脚本位置
run_path = os.path.split(os.path.realpath(__file__))[0]
获取磁盘信息
#!/usr/bin/env python
import subprocess
#Command 1
def uname_func():
uname="uname"
uname_arg="-a"
print "Gathering system information with %s command:\n" % uname
subprocess.call([uname,uname_arg])
#command 2
def disk_func():
diskspace = "df"
diskspace_arg="-h"
print "Gathering diskspace information %s command:\n" % diskspace
subprocess.call([diskspace,diskspace_arg])
def main():
uname_func()
disk_func()
main()
上一篇: python读取word文档表格里的数据
下一篇: Python 绘图利器 —— ggplo
49771
48996
39687
36730
31128
27957
26920
21728
21639
19991
68°
719°
1271°
1221°
1091°
2203°
1310°
1927°
2176°
1686°