代码:
[root@oracle-cluster-3 ~]# python Python 2.7.5 (default, May 8 2014, 17:35:19) [GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess >>> subprocess.call(["ls","-l","/script/"]) total 4 drwxr-xr-x 2 root root 42 May 12 10:53 python drwxr-xr-x 2 root root 4096 Apr 26 17:20 shell 0 >>>
——————————————————
Done。