Linux shell to python

Paul van der Linden mail at
Mon Jul 30 18:55:29 CEST 2012

You can do this with one subprocess.Popen and some python commands.

The alternative is to pipe some subprocess.Popen commands together.

Or for the quick way out (but I think you better stick with bash scripting then):

Don't know about it's stability/ubs/etc, never used it.
-----Original message-----
From:Vikas Kumar Choudhary <vikas.choudhary at>
Sent:Mon 30-07-2012 09:34
Subject:Linux shell to python
To:python-list at; 
Dear friends,

I just joined the group.
I was trying porting from bash shell to python.

 let me know if someone has tried to implement (grep and PIPE)  shell commands in python `lspci | grep Q | grep  "$isp_str1" | grep "$isp_str2" | cut -c1-7'
 I tried to use python subprocess and OS.Popen modules.

Thanks & Regard's

Vikas Kumar Choudhary 

(Yahoo,MSN-Hotmail,Skype) Messenger = vikas.choudhary
Please Add Me in Your Messenger List for Better Communication
P  Please consider the environment before printing this e-mail
Do not print this email unless it is absolutely necessary. 
Save papers, Save tree.
Note: This e-mail is confidential and may also be privileged, this is for the intended recipients only. If you are not the intended recipient, please delete the message and notify me immediately; you should not copy or use it for any purpose, nor disclose its contents to any other person.

Notice:  All email and instant messages (including attachments) sent to or from This E-mail id , may be retained, monitored and/or reviewed, or authorized law enforcement personnel, without further notice or consent.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list