Python session 4 subprocess- by Gopal.A (Python developer)

Post on 24-Jun-2015

188 Views

Category:

Education

1 Downloads

Preview:

Click to see full reader

Transcript

Python Execute Unix / Linux Command

l There are two modules in python to excute the linux commands.

l 1. os module l 2. subprocess module

l syntax:

l subprocess.call(args, *, stdin=None, stdout=None, stderr=None, shell=false)

l PASSING ARGUMENTS

l SUBPROCESS.POPEN( ) - STDOUT AND STDERR

l Popen.communicate() interacts with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached.

SHELL VALUE

top related