对照着书本的教导,定义了函数,
[root@binzai learning-python]# cat sysinfo.py
#!/usr/bin/env python
import subprocess
def diskspace():
diskspace="df"
diskspace_arg="-h"
print "Gathering diskspace information with %s command:\n" % diskspace
subprocess.call([diskspace,diskspace_arg])
diskspace()
运行时报错了,小弟不解,python比bash shell麻烦多了
[root@binzai learning-python]# ./sysinfo.py
File "./sysinfo.py", line 4
diskspace="df"
^
IndentationError: expected an indented block
蓝山帝景
RISEBY
相关分类