I have a problem with this piece of code:
import sys
for line in sys.stdin:
print "You said!", line
Namely, it seems that the stdin buffers the input, so there is no reply until
a huge amount of text has bin written. The iterator returned by xreadlines
has the same behavior.
The
In message <[EMAIL PROTECTED]>, Luis
Zarrabeitia wrote:
> I have a problem with this piece of code:
>
>
> import sys
> for line in sys.stdin:
> print "You said!", line
>
>
> Namely, it seems that the stdin buffers the input, so there is no reply
> until a huge amount of text has bi
Luis Zarrabeitia wrote:
> I have a problem with this piece of code:
>
>
> import sys
> for line in sys.stdin:
> print "You said!", line
>
>
> Namely, it seems that the stdin buffers the input, so there is no reply until
> a huge amount of text has bin written. The iterator returned by
On Tuesday 07 October 2008 05:33:18 pm George Sakkis wrote:
> Not an answer to your actual question, but you can keep the 'for' loop
> instead of rewriting it with 'while' using the iter(function,
> sentinel) idiom:
>
> for line in iter(sys.stdin.readline, ""):
> print "You said!", line
You're
On Tuesday 07 October 2008 05:12:28 pm Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Luis
>
> Zarrabeitia wrote:
> > I have a problem with this piece of code:
> >
> >
> > import sys
> > for line in sys.stdin:
> > print "You said!", line
> >
> >
> > Namely, it seems that
On Oct 7, 8:13 pm, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote:
> On Tuesday 07 October 2008 05:33:18 pm George Sakkis wrote:
>
> > Not an answer to your actual question, but you can keep the 'for' loop
> > instead of rewriting it with 'while' using the iter(function,
> > sentinel) idiom:
>
> > for
>
> I guess the phrasing "hidden read-ahead buffer" implies that buffering
> cannot be turned off (or at least it is not intended to even if it's
> somehow possible).
>
I think it can be done, but you would have to use a different approach on
linux than on windows. Linux requires fcntl (I dont kno
On Tuesday 07 October 2008 11:27:19 pm George Sakkis wrote:
> """
> In order to make a for loop the most efficient way of looping over the
> lines of a file (a very common operation), the next() method uses a
> hidden read-ahead buffer. As a consequence of using a read-ahead
> buffer, combining nex
On Wed, 8 Oct 2008 09:28:55 -0400, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote:
On Tuesday 07 October 2008 11:27:19 pm George Sakkis wrote:
"""
In order to make a for loop the most efficient way of looping over the
lines of a file (a very common operation), the next() method uses a
hidden read-ah
Luis Zarrabeitia wrote:
>But it doesn't say how to put the file object in non-blocking mode. (I was
>trying to put the file object in non-blocking mode to test next()'s
>behavior). ??Ideas?
# Some magic to make a file non blocking - from the internet
def unblock(f):
"""Given file 'f', sets
En Wed, 08 Oct 2008 10:28:55 -0300, Luis Zarrabeitia <[EMAIL PROTECTED]>
escribió:
And I may try to find next()'s implementation... I guess I'll be
downloading
python's source when my bandwidth allows it (or find it on a browseable
repository)
Try http://svn.python.org - in particular,
h
Hi!
I wanna write a file processor in python (Windows XP).
I wanna use pipe, and not parameters.
When I write this:
...
l = []
while 1:
t = sys.stdin.read(1)
if t == '':
break
l.append(t)
t = "".join(l)
...
and use code this:
process.py http://mail.python.org/mailman/listi
[EMAIL PROTECTED] wrote in news:mailman.2448.1223974725.3487.python-
[EMAIL PROTECTED] in comp.lang.python:
> Hi!
>
> I wanna write a file processor in python (Windows XP).
> I wanna use pipe, and not parameters.
>
> When I write this:
>
> ...
> l = []
> while 1:
> t = sys.stdin.read(1)
>
Hi all,
I wrote a replacement for urlview to properly extract URLs from emails.
You can find the first draft here:
https://github.com/the-isz/pyurlview
When I call it with an email file passed to the '-f' argument, it does
pretty much what I want already. However, I intend to use it in mutt,
w
I have a program that runs like this:
foo.py https://mail.python.org/mailman/listinfo/python-list
Hi again,
sorry for replying to my own mail, but is there really no solution? Can
curses really not be used in this situation?
Thanks again,
Timo
On Sun, Aug 11, 2013 at 02:05:11PM +0200, Timo Schmiade wrote:
> Hi all,
>
> I wrote a replacement for urlview to properly extract URLs from emails.
Op 11-08-13 14:05, Timo Schmiade schreef:
Hi all,
I wrote a replacement for urlview to properly extract URLs from emails.
You can find the first draft here:
https://github.com/the-isz/pyurlview
When I call it with an email file passed to the '-f' argument, it does
pretty much what I want al
I'd like to bump this. I asked a similar question a few weeks ago and
had no reply. Here's my question:
I'm fairly new to python and even newer to curses. Does any one have a
good solution for how to embed the output of a subprocess (ex.
subprocess.Popen("htop", stdout=subprocess.PIPE)) into an nc
Op 04-09-13 20:45, Veritatem Ignotam schreef:
I'd like to bump this. I asked a similar question a few weeks ago and
had no reply. Here's my question:
I'm fairly new to python and even newer to curses. Does any one have a
good solution for how to embed the output of a subprocess (ex.
subprocess.P
On Thu, Oct 24, 2013 at 4:25 AM, Tim Daneliuk wrote:
> I have a program that runs like this:
>
> foo.py
> I want to reconnect stdin to the tty as usual after 'inputfile'
> has been read so that things like raw_input and getpass
> will work as expected.
>
> So, after I do = sys.stdin.readli
Tim Daneliuk writes:
> I have a program that runs like this:
>
> foo.py I want to reconnect stdin to the tty as usual after 'inputfile'
> has been read so that things like raw_input and getpass
> will work as expected.
Why? That's at odds with how the user has already chosen to run the
progra
On Thu, Oct 24, 2013 at 7:46 AM, Ben Finney wrote:
> Can you speak more about how you intend your program to be used? The
> above request is incoherent, and I suspect you've made a design mistake.
There are times when this is correct behaviour - like asking for
passwords (SSH and sudo work like t
On Wed, Oct 23, 2013, at 16:52, Chris Angelico wrote:
> There are times when this is correct behaviour - like asking for
> passwords (SSH and sudo work like this).
Less (or pagers generally, or an interactive text editor that allows
creating a file from standard input) would be another example of
random...@fastmail.us writes:
> On Wed, Oct 23, 2013, at 16:52, Chris Angelico wrote:
> > There are times when this is correct behaviour - like asking for
> > passwords (SSH and sudo work like this).
>
> Less (or pagers generally, or an interactive text editor that allows
> creating a file from st
On Thu, Oct 24, 2013 at 9:20 AM, Ben Finney wrote:
> random...@fastmail.us writes:
>
>> On Wed, Oct 23, 2013, at 16:52, Chris Angelico wrote:
>> > There are times when this is correct behaviour - like asking for
>> > passwords (SSH and sudo work like this).
>>
>> Less (or pagers generally, or an i
On 10/23/2013 05:20 PM, Ben Finney wrote:
random...@fastmail.us writes:
On Wed, Oct 23, 2013, at 16:52, Chris Angelico wrote:
There are times when this is correct behaviour - like asking for
passwords (SSH and sudo work like this).
Less (or pagers generally, or an interactive text editor tha
Tim Daneliuk writes:
> 'Easy there Rainman
I'll thank you not to use mental deficiency as some kind of insult.
Calling someone “Rainman” is to use autistic people as the punchline of
a joke. We're a community that doesn't welcome such ableist slurs.
> The goal of the exercise was:
>
> - Read a
On 10/23/2013 10:53 PM, Ben Finney wrote:
Right. Congratulations for learning more about the design of the OS and
making a program that fits in well:-)
It's only possible because, after some 30 years of doing this, I feel
very abelist ...
--
On 10/23/2013 10:53 PM, Ben Finney wrote:
Congratulations for learning more about the design of the OS and
making a program that fits in well
It's only because of some 30 years of doing this that I now
feel quite abelist ...
--
--
Tim Daneliuk writes:
> On 10/23/2013 10:53 PM, Ben Finney wrote:
> > Right. Congratulations for learning more about the design of the OS and
> > making a program that fits in well:-)
>
> It's only possible because, after some 30 years of doing this, I feel
> very abelist ...
You may be unaware,
On 24/10/2013 04:53, Ben Finney wrote:
Tim Daneliuk writes:
'Easy there Rainman
I'll thank you not to use mental deficiency as some kind of insult.
Calling someone “Rainman” is to use autistic people as the punchline of
a joke. We're a community that doesn't welcome such ableist slurs.
I
Mark Lawrence writes:
> On 24/10/2013 04:53, Ben Finney wrote:
> > Tim Daneliuk writes:
> >
> >> 'Easy there Rainman
> >
> > I'll thank you not to use mental deficiency as some kind of insult.
> > Calling someone “Rainman” is to use autistic people as the punchline
> > of a joke. We're a communi
On 2013-10-24 14:53, Ben Finney wrote:
> I think the request is incoherent: If you want to allow the user to
> primarily interact with the program, this is incompatible with also
> wanting to redirect standard input.
As a counter-example, might I suggest one I use regularly:
gimme_stuff_on_stdo
On 24 October 2013 01:09, Tim Daneliuk wrote:
>
> Now that I think about it, as I recall from the prehistoric era of writing
> lots of assembler and C, if you use shell redirection, stdin shows
> up as a handle to the file
Yes this is true. A demonstration using seek (on Windows but it is the
sam
On 10/23/2013 11:54 PM, Ben Finney wrote:
we don't welcome ableist (nor sexist) behaviour.
Well now I just feel so very awful ...
--
Tim Daneliuk tun...@tundraware.com
PGP Key: http://www.tundraware.com/PG
On 24 October 2013 12:58, Tim Daneliuk wrote:
> On 10/23/2013 11:54 PM, Ben Finney wrote:
>>
>> we don't welcome ableist (nor sexist) behaviour.
>
> Well now I just feel so very awful ...
Please end this line of discussion. Ben is right: your comment was
entirely unnecessary and could easily offe
On 10/24/2013 07:10 AM, Oscar Benjamin wrote:
On 24 October 2013 12:58, Tim Daneliuk wrote:
On 10/23/2013 11:54 PM, Ben Finney wrote:
we don't welcome ableist (nor sexist) behaviour.
Well now I just feel so very awful ...
Please end this line of discussion. Ben is right: your comment was
Am Donnerstag, 24. Oktober 2013 15:41:52 UTC+2 schrieb Tim Daneliuk:
> On 10/24/2013 07:10 AM, Oscar Benjamin wrote:
>> On 24 October 2013 12:58, Tim Daneliuk wrote:
>>> On 10/23/2013 11:54 PM, Ben Finney wrote:
we don't welcome ableist (nor sexist) behaviour.
>>> Well now I just feel so very
On 10/24/2013 06:41 AM, Tim Daneliuk wrote:
But now I feel bad about myself and it's all your fault.
Really?
*plonk*
--
https://mail.python.org/mailman/listinfo/python-list
On 10/24/2013 09:36 AM, feedthetr...@gmx.de wrote:
Am Donnerstag, 24. Oktober 2013 15:41:52 UTC+2 schrieb Tim Daneliuk:
On 10/24/2013 07:10 AM, Oscar Benjamin wrote:
On 24 October 2013 12:58, Tim Daneliuk wrote:
On 10/23/2013 11:54 PM, Ben Finney wrote:
we don't welcome ableist (nor sexist)
On 10/24/2013 01:14 AM, Mark Lawrence wrote:
On 24/10/2013 04:53, Ben Finney wrote:
Tim Daneliuk writes:
'Easy there Rainman
I'll thank you not to use mental deficiency as some kind of insult.
Calling someone “Rainman” is to use autistic people as the punchline of
a joke. We're a community
41 matches
Mail list logo