-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
85 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
SHCMD ~~上海崇明岛~~ | ||
==================== | ||
|
||
Note: Work in Progress. | ||
|
||
This lib aims to provide a Human friendly interface for subprocess. | ||
|
||
If you need piped subprocesses, give [envoy](https://github.com/kennethreitz/envoy) a try. | ||
|
||
|
||
[![Build Status][travis-image]][travis-url] | ||
[![Coverage Status][coverage-image]][coverage-url] | ||
[![Requirements Status][req-status-image]][req-status-url] | ||
|
||
|
||
### Usage | ||
```python | ||
import shcmd | ||
|
||
with shcmd.cd("/tmp"): | ||
# get result directly | ||
assert shcmd.run("pwd") == "/tmp" | ||
# get streamed result packed in a generator | ||
streamed = shcmd.run("ls", stream=True) | ||
for filename in streamed.iter_lines(): | ||
print(filename) | ||
# get full stdout/stderr | ||
print(streamed.stdout) | ||
print(streamed.stderr) | ||
``` | ||
|
||
|
||
[travis-url]: https://travis-ci.org/SkyLothar/shcmd | ||
[travis-image]: https://travis-ci.org/SkyLothar/shcmd.svg?branch=master | ||
[coverage-image]: https://coveralls.io/repos/SkyLothar/shcmd/badge.png | ||
[coverage-url]: https://coveralls.io/r/SkyLothar/shcmd | ||
[req-status-url]: https://requires.io/github/SkyLothar/shcmd/requirements/?branch=master | ||
[req-status-image]: https://requires.io/github/SkyLothar/shcmd/requirements.svg?branch=master |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters