>>> import subprocess
>>> mycmd=subprocess.getoutput('df -h | grep home | gawk \'{ print $1 }\' | cut -d\'/\' -f3')
>>> mycmd
'sda6'
>>>
More Related Contents:
- How do I use subprocess.Popen to connect multiple processes by pipes?
- How to use `subprocess` command with pipes
- Retrieving the output of subprocess.call() [duplicate]
- Multiple pipes in subprocess
- Pipe subprocess standard output to a variable [duplicate]
- File not found error when launching a subprocess containing piped commands
- subprocess readline hangs waiting for EOF
- link several Popen commands with pipes
- Python subprocess: how to use pipes thrice? [duplicate]
- real time subprocess.Popen via stdout and PIPE
- Communicate multiple times with a process without breaking the pipe?
- Actual meaning of ‘shell=True’ in subprocess
- How to terminate a python subprocess launched with shell=True
- How to redirect output with subprocess in Python?
- Python subprocess get children’s output to file and terminal?
- Subprocess changing directory
- Blocking and Non Blocking subprocess calls
- Launch a completely independent process
- How do I pipe a subprocess call to a text file?
- Multiple inputs and outputs in python subprocess communicate
- Python C program subprocess hangs at “for line in iter”
- Pipe character in Python
- Popen with conflicting executable/path
- How to write to stdout AND to log file simultaneously with Popen?
- Python running as Windows Service: OSError: [WinError 6] The handle is invalid
- Display realtime output of a subprocess in a tkinter widget
- Can you make a python subprocess output stdout and stderr as usual, but also capture the output as a string? [duplicate]
- Subprocess timeout failure
- What’s the difference between subprocess Popen and call (how can I use them)?
- Run subprocess and print output to logging