Blog categories

Comments

[Python] Python 으로 Shell command 수행하기

[Python] Python 으로 Shell command 수행하기

import subprocess as sp
 
def bash_command(command):
    popen = sp.Popen(command)
    out, err = popen.communicate()
    return out
popen = subprocess.Popen(['/bin/bash', '-c', command])

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

div#stuning-header .dfd-stuning-header-bg-container {background-image: url(https://tech.sangron.com/wp-content/uploads/sites/2/2018/02/python_wallpaper_background.jpg);background-color: #3f3f3f;background-size: cover;background-position: top center;background-attachment: initial;background-repeat: no-repeat;}#stuning-header div.page-title-inner {min-height: 350px;}