Comments (12)
Correct. :)
from envoy.
so how to proceed ?
from envoy.
+1, this would be useful
from envoy.
Yes, let me crush my grey matter not now, after three days :)
Thanks & Regards
"Talk is cheap, show me the code" -- Linus Torvalds
kracekumar
www.kracekumar.com
*
from envoy.
I'm torn on this. I'm not sure how this would be very useful programmatically.
from envoy.
Since envoy
is alternate to subprocess
people tend to think envoy.run("let us shoot the command here")
, since subprocess
works fine with >>
<<
people expect to try all sorts in envoy. We can parse the command and in case any one if them is present >
,<
,>>
,<<
, we will achieve the desired result using with
and open
if it is a file. I am not 100%sure this will work.
envoy rocks
if command is cat read.txt > write.txt
In [9]: with open('read.txt', 'r') as f:
with open('write.txt', 'w') as w:
w.writelines(f)
...:
In [10]: cat write.txt
envoy rocks```
from envoy.
Programmatically, it's about as easy to redirect as it is to compose an initial function:
envoy.run("cat %s" % f1)
envoy.run("cat %s >> %s" % (f1,f2))
Granted "cat" is a bit contrived...the redirection does still save the extra keystrokes of opening a file with the appropriate mode, grabbing the stdout/stderr, and writing.
with open(f2, "a") as h: h.write(envoy.run("cat f1").std_out)
vs
envoy.run("cat f1 >> %s" % f2)
It feels more natural to use redirection in the command string. It would also seem consistent with the current API since piping is there.
Thoughts?
from envoy.
@amoffat : seems much better than the one i suggested. We can still think on it.
from envoy.
how about performance and compatibility?
i've run into this issue when i tried to do a pg_dump w/ envoy.run(), i know that "pg_dump ... > file.sql" works w/o problems for extremely large files.
will something like "with open(...) as h: h.write(envoy.run("pg_dump ...").std_out)" also work w/o problems?
from envoy.
examples
- nohup python test.py >> test.out &
- command | tee pipe.py
We might need to write own grammar, i feel pbs should be handly when compared to envoy, @kennethreitz what you say ?
from envoy.
Just ran into this. :/
Parsing shell commands is a tricky business, with a lot of subtle traps. But that's why I want a library to do it for me. ;)
from envoy.
This project is in a bit of a crisis state — it's really useful, and I use it on a daily basis. However, I wrote it in a few afternoons several years ago and haven't touched it since. In order to get the project into a stable state I'm closing all issues and pull requests
Don't take this as aggressive — it's just necessary for the project to make any progress any time soon (it's pretty clear the project is effectively unmaintained at the moment). Great things to come! Please watch the GitHub logs and feel free to re-open this discussion soon. I just need to really it into a good state first.
✨ ❤️ ✨
from envoy.
Related Issues (20)
- Problem with Unicode HOT 2
- missing license HOT 2
- Roadmap to new release HOT 6
- AttributeErro on self.process.returncode HOT 1
- piping stdout from one process into tar fails HOT 6
- lsof command returns null HOT 1
- status_code in core.py trips up most everything HOT 1
- Better error handling for not found command HOT 1
- "OSError: [Errno 2] No such file or directory" from envoy.run when the command is unicode HOT 1
- Systematic <defunct> process using envoy.connect() HOT 2
- AttributeError: 'NoneType' object has no attribute 'returncode' HOT 1
- Upload a wheel to PyPI HOT 2
- Use subprocess32, the backport from Python 3, that guarantees reliability on POSIX HOT 4
- Truncation of stdout HOT 9
- make it easier to figure out if there is an error.
- shell=True option request
- envoy 0.0.3 the problem of connect method
- error using unicode commands HOT 2
- connection error, child exception HOT 1
- adb shell ps | grep mobile
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from envoy.