Be myself :: 2019/01 글 목록

달력

12019  이전 다음

  •  
  •  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  •  
  •  

'2019/01'에 해당되는 글 1건

  1. 2019.01.16 특정 커멘드 결과값 계속 받아오기

import subprocess
import shlex

def run_command(cmd):
    p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
    while True:
        output = process.stdout.readline()
        if output == '' and process.poll() is not None:
            break

        if output:
            print output
    rc = process.poll()
    return rc

def main():
    print "Catch go"
    cmd = "something"
    run_command(shlex.split(cmd))

if __name__ == '__main__':
    main()

Posted by flack3r