SlideShare a Scribd company logo
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
l

syntax:

l

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

PASSING ARGUMENTS
Python session 4 subprocess- by Gopal.A (Python developer)
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.
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)
SHELL VALUE
Python session 4 subprocess- by Gopal.A (Python developer)

More Related Content

PDF
PDF
Macros in nemerle
PPT
Operating systems
PPTX
Ruby basics || updated
PPT
STORAGE CLASSES
DOCX
Nested Loops in C unit2.docx
PDF
Presentation buffer overflow attacks and theircountermeasures
PPT
Functions
Macros in nemerle
Operating systems
Ruby basics || updated
STORAGE CLASSES
Nested Loops in C unit2.docx
Presentation buffer overflow attacks and theircountermeasures
Functions

What's hot (17)

PDF
Pointers & functions
PDF
Iterator protocol
PDF
Composite types
PPTX
Loop c++
PPTX
Programming in python - Week 7,8
PPTX
Programming in python - Week 4
PPTX
Do...while loop structure
PDF
Eth cc --eth2-tests-and-implementation
PDF
Linq & lambda overview C#.net
PDF
DEF CON 23 - Ryan o'neil - advances in linux forensics with ecfs
PPTX
#4 (Remote Method Invocation)
PPT
강의자료8
PPTX
PPTX
MATLAB Programming - Loop Control Part 2
PPTX
Error and exception in python
PPT
NS2 Classifiers
PDF
Cap'n Proto (C++ Developer Meetup Iasi)
Pointers & functions
Iterator protocol
Composite types
Loop c++
Programming in python - Week 7,8
Programming in python - Week 4
Do...while loop structure
Eth cc --eth2-tests-and-implementation
Linq & lambda overview C#.net
DEF CON 23 - Ryan o'neil - advances in linux forensics with ecfs
#4 (Remote Method Invocation)
강의자료8
MATLAB Programming - Loop Control Part 2
Error and exception in python
NS2 Classifiers
Cap'n Proto (C++ Developer Meetup Iasi)
Ad

More from Navaneethan Naveen (20)

PPT
Class inheritance 13 session - SHAN
PPT
Python session 12
PPT
Python session 11
PPT
V irtualisation.1
PPT
Python session.11 By Shanmugam
PPT
Virtualisation-11
PPT
Networking session-4-final by aravind.R
PPT
Networking session3
PPT
WIN-ADCS-10
PPT
Python session 10
PPT
Python multithreading session 9 - shanmugam
PPT
Python session 8
PPT
PPT
Virtualization session 8
PDF
Virtualization session 7 by Gugan
PPT
Python session 7 by Shan
PPT
Virtualization s4.1
PPT
Python session 6
PPT
Gpo windows(4)
PPTX
Windows session 5 : Basics of active directory
Class inheritance 13 session - SHAN
Python session 12
Python session 11
V irtualisation.1
Python session.11 By Shanmugam
Virtualisation-11
Networking session-4-final by aravind.R
Networking session3
WIN-ADCS-10
Python session 10
Python multithreading session 9 - shanmugam
Python session 8
Virtualization session 8
Virtualization session 7 by Gugan
Python session 7 by Shan
Virtualization s4.1
Python session 6
Gpo windows(4)
Windows session 5 : Basics of active directory
Ad

Recently uploaded (20)

PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Classroom Observation Tools for Teachers
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Cell Types and Its function , kingdom of life
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
202450812 BayCHI UCSC-SV 20250812 v17.pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Microbial disease of the cardiovascular and lymphatic systems
Classroom Observation Tools for Teachers
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
STATICS OF THE RIGID BODIES Hibbelers.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pharmacology of Heart Failure /Pharmacotherapy of CHF
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
A systematic review of self-coping strategies used by university students to ...
Complications of Minimal Access Surgery at WLH
Microbial diseases, their pathogenesis and prophylaxis
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Cell Types and Its function , kingdom of life
2.FourierTransform-ShortQuestionswithAnswers.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Pharma ospi slides which help in ospi learning
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE

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