Python subprocess.call()

How do I execute standard Unix or Linux shell commands using Python? Is there a command to invoke Unix commands using Python programs?

{ 6 comments }

I am a new Python user. I wanted to run a Linux or Unix external program. For example, I would like to call an external program called /bin/date with my python script and get the output on screen or store in a variable. How do I display such output and exit status (return code) of /bin/date program using a Python script?

{ 1 comment }