Python Execute Unix / Linux Command

l

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

l

1. os module
2. ...
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 ...
SHELL VALUE
Python session 4 subprocess- by Gopal.A (Python developer)
Python session 4 subprocess- by Gopal.A (Python developer)
Python session 4 subprocess- by Gopal.A (Python developer)
Python session 4 subprocess- by Gopal.A (Python developer)
Python session 4 subprocess- by Gopal.A (Python developer)
Upcoming SlideShare
Loading in …5
×

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

408 views

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
408
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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

  1. 1. Python Execute Unix / Linux Command l There are two modules in python to excute the linux commands. l 1. os module 2. subprocess module l
  2. 2. l syntax: l subprocess.call(args, *, stdin=None, stdout=None, stderr=None, shell=false)
  3. 3. l PASSING ARGUMENTS
  4. 4. l SUBPROCESS.POPEN( ) - STDOUT AND STDERR
  5. 5. l Popen.communicate() interacts with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached.
  6. 6. SHELL VALUE

×