Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 39 lines (25 sloc) 0.689 kB
82e112c @kennethreitz for Humans™
kennethreitz authored
1 Envoy: Python Subprocesses for Humans.
2 ======================================
f3fb4aa @kennethreitz read me
kennethreitz authored
3
504a690 @kennethreitz longer readme
kennethreitz authored
4 **Note:** Work in progress.
f3fb4aa @kennethreitz read me
kennethreitz authored
5
9521a69 @kennethreitz README.
kennethreitz authored
6 This is a convenience wrapper around the `subprocess` module.
7
096e3a0 @kennethreitz you want it.
kennethreitz authored
8 You don't need this.
9521a69 @kennethreitz README.
kennethreitz authored
9
3a05bab @kennethreitz new url
kennethreitz authored
10 .. image:: https://github.com/kennethreitz/envoy/raw/master/ext/in_action.png
9521a69 @kennethreitz README.
kennethreitz authored
11
096e3a0 @kennethreitz you want it.
kennethreitz authored
12 But you want it.
13
9521a69 @kennethreitz README.
kennethreitz authored
14
f3fb4aa @kennethreitz read me
kennethreitz authored
15 Usage
16 -----
17
2bc1487 @kennethreitz read it
kennethreitz authored
18 Run a command, get the response::
f3fb4aa @kennethreitz read me
kennethreitz authored
19
a9682e7 @kennethreitz basics
kennethreitz authored
20 >>> r = envoy.run('git config', data='data to pipe in', timeout=2)
504a690 @kennethreitz longer readme
kennethreitz authored
21
f3fb4aa @kennethreitz read me
kennethreitz authored
22 >>> r.status_code
23 129
24 >>> r.std_out
25 'usage: git config [options]'
26 >>> r.std_err
27 ''
e6b0d87 @kennethreitz pipe strings
kennethreitz authored
28
2bc1487 @kennethreitz read it
kennethreitz authored
29 Pipe stuff around too::
e6b0d87 @kennethreitz pipe strings
kennethreitz authored
30
4ad0bc1 @kennethreitz history
kennethreitz authored
31 >>> r = envoy.run('uptime | pbcopy')
32
33 >>> r.command
34 'pbcopy'
35 >>> r.status_code
36 0
37
38 >>> r.history
39 [<Response 'uptime'>]
Something went wrong with that request. Please try again.