IT2013. 11. 5. 00:17
반응형

python 실행 스크립트


#!/usr/bin/env python


""" execute something outside of Python

"""


import subprocess


retcode = subprocess.call(['ls', '-l', '/home'])

print "returned", retcode


retcode = subprocess.call(['ls', '-l', '/home/justflying'])

print "returned", retcode




drwxr-xr-x 32 buster     buster     4096 11월  5 00:09 buster

drwx------  2 root       root       4096  9월  9 00:08 iso

drwxr-xr-x 58 jlpark     jlpark     4096 11월  4 23:49 jlpark

drwxr-xr-x 25 justflying justflying 4096 11월  4 23:56 justflying

returned 0

합계 44

-rw-r--r-- 1 justflying justflying 8445  4월 19  2013 examples.desktop

drwxr-xr-x 2 justflying justflying 4096  4월 19  2013 공개

drwxr-xr-x 2 justflying justflying 4096  4월 19  2013 다운로드

drwxr-xr-x 2 justflying justflying 4096  4월 19  2013 문서

drwxr-xr-x 2 justflying justflying 4096  4월 19  2013 바탕화면

drwxr-xr-x 2 justflying justflying 4096  4월 19  2013 비디오

drwxr-xr-x 2 justflying justflying 4096  4월 19  2013 사진

drwxr-xr-x 2 justflying justflying 4096  4월 19  2013 음악

drwxr-xr-x 2 justflying justflying 4096  4월 19  2013 템플릿

returned 0












반응형

'IT' 카테고리의 다른 글

vi advance use key  (4) 2013.11.07
VI 에디터 사용법  (4) 2013.11.07
forever 데몬 실행  (2) 2013.11.04
debian redhat runlevel 설정  (8) 2013.11.04
무저껀 쓸만한 프로그램  (0) 2013.10.03
Posted by Dream Come True