> On Tue, 28 Jul 2009 04:06:45 am Eric Pruitt wrote:
> > I am implementing the file wrapper using changes to subprocess.Popen
> > that also make it asynchronous and non-blocking so implementing "r+"
> > should be trivial to do. How about handling stderr? I have the
> > following ideas: leave out su
Well, with a few changes to your code, that would indeed work (you are using
stdin as your pipe. Correct me if I'm wrong but if you intend to read from
it, you need to change it to "stdout = subprocess.PIPE" and the other lines
as well to reflect this change). My Google Summer of Code modifications
Hmm... can't you do this?
if encryptionEnabled:
p = subprocess.Popen(["gpg", "--decrypt", "supersecret.html.gpg"],
stdin = subprocess.PIPE)
fileobj = p.stdin
else:
fileobj = open("notsosecret.html")
I think that works. Is there something this way won't work for? You
can also do the sa
My motivation came from an instance when I was using subprocess.Popen for a
Linux / Windows cross platform program. In part of the program, I was
writing and reading to a cron like object. On Windows, it was a text file
and on Linux it would be the crontab executable. Had I been able to
substitute
On Mon, Jul 27, 2009 at 5:32 PM, Glyph Lefkowitz wrote:
> On Mon, Jul 27, 2009 at 3:04 PM, Paul Moore wrote:
>>
>> I like MRAB's idea of using a (non-standard) "e" flag to include
>> stderr. So "r" reads from stdout, "re" reads from stdout+stderr.
>>
>> Anything more complicated probably should ju
On Mon, Jul 27, 2009 at 3:04 PM, Paul Moore wrote:
> I like MRAB's idea of using a (non-standard) "e" flag to include
> stderr. So "r" reads from stdout, "re" reads from stdout+stderr.
>
> Anything more complicated probably should just use "raw" Popen
> objects. Don't overcomplicate the interface
On Tue, 28 Jul 2009 04:06:45 am Eric Pruitt wrote:
> I am implementing the file wrapper using changes to subprocess.Popen
> that also make it asynchronous and non-blocking so implementing "r+"
> should be trivial to do. How about handling stderr? I have the
> following ideas: leave out support for
Steven D'Aprano wrote:
On Tue, 28 Jul 2009 03:21:30 am MRAB wrote:
What about stderr? You could add "e" if you want to read from it.
"Read from stderr" is just a read. "Write to stderr" is just a write.
The difference between reading stdout and stderr is not that you have
different modes, b
On Tue, 28 Jul 2009 03:21:30 am MRAB wrote:
> What about stderr? You could add "e" if you want to read from it.
"Read from stderr" is just a read. "Write to stderr" is just a write.
The difference between reading stdout and stderr is not that you have
different modes, but that you are reading f
2009/7/27 Eric Pruitt :
> I am implementing the file wrapper using changes to subprocess.Popen that
> also make it asynchronous and non-blocking so implementing "r+" should be
> trivial to do. How about handling stderr? I have the following ideas: leave
> out support for reading from stderr, make i
I am implementing the file wrapper using changes to subprocess.Popen that
also make it asynchronous and non-blocking so implementing "r+" should be
trivial to do. How about handling stderr? I have the following ideas: leave
out support for reading from stderr, make it so that there is an optional
a
Paul Moore wrote:
2009/7/27 Eric Pruitt :
Hello,
Since there was a bit of confusion last time, I'll start by saying I am
working on the subprocess.Popen module for Google Summer of Code. One of the
features I am implementing is a class so that a running process can stand in
in place of a file.
2009/7/27 Eric Pruitt :
> Hello,
>
> Since there was a bit of confusion last time, I'll start by saying I am
> working on the subprocess.Popen module for Google Summer of Code. One of the
> features I am implementing is a class so that a running process can stand in
> in place of a file. For exampl
Hello,
Since there was a bit of confusion last time, I'll start by saying I am
working on the subprocess.Popen module for Google Summer of Code. One of the
features I am implementing is a class so that a running process can stand in
in place of a file. For examples, instead of open( "filelist", mo
14 matches
Mail list logo