源码test.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- import os os.system("df -h")
运行结果(与直接在终端运行df -h一样):
Filesystem Size Used Avail Use% Mounted on /dev/vda1 50G 2.6G 45G 6% /