import subprocess #프로세스 개수 카운팅해서 변수에 담기 #int 로 안싸돌면 b'10\n' 이런식으로 나옴 ㅠㅠㅋㅋ pid_count = int(subprocess.check_output('ps -eaf | grep 누굴찾을까요 | grep -v grep | grep -v vim | wc -l', shell=True)) #프로세스 개수 카운팅해서 echo 처럼 출력하기(print 별도로 해주지 않아도 됨) subprocess.call('ps -eaf | grep 누굴찾을까여 | grep -v grep | grep -v vim | wc -l', shell=True)