测试linux python import module

源码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%             /
原文地址:https://www.cnblogs.com/xbit/p/9441614.html