测试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%             /

 

posted @ 2018-08-08 11:12  xbit  阅读(213)  评论(0编辑  收藏  举报