Peter Gsellmann <[EMAIL PROTECTED]> writes:
> Will McDonald wrote:
>> That's a good point. I did wonder if it'd just have to sit there
>> waiting for input much like cat would. I think that's preferable, and
>> simpler :), than implementing timeouts.
>>
> In unix you can always use select.select
Will McDonald wrote:
> > There are more experienced UNIXers here, but from my POV I don't see how
> > that can happen. The reason is simply that
> >
> > - sys.stdin alwasy exists (unless you close it yourself)
> >
> > - in a pipe (which this essentially is) there is now way to know if there
> >
On 24/01/06, Roland Heiber <[EMAIL PROTECTED]> wrote:
> Will McDonald wrote:
> > Hi all.
> >
> > I'm writing a little script that operates on either stdin or a file
> > specified on the command line when run. I'm trying to handle the
> > situation where the script's run without any input gracefully
Will McDonald wrote:
> Hi all.
>
> I'm writing a little script that operates on either stdin or a file
> specified on the command line when run. I'm trying to handle the
> situation where the script's run without any input gracefully but
> can't think how to test for stdin.
>
Hi,
maybe http://d
Will McDonald wrote:
> On 23/01/06, Diez B. Roggisch <[EMAIL PROTECTED]> wrote:
>> > I can get the script to behave as expected when content's piped to it
>> > using sys.stdin but I'd like to know that there's data coming from
>> > stdin or fail and print the useage again. Is there a simple way to
On 23/01/06, Diez B. Roggisch <[EMAIL PROTECTED]> wrote:
> > I can get the script to behave as expected when content's piped to it
> > using sys.stdin but I'd like to know that there's data coming from
> > stdin or fail and print the useage again. Is there a simple way to
> > achieve this?
>
> Ther
> I can get the script to behave as expected when content's piped to it
> using sys.stdin but I'd like to know that there's data coming from
> stdin or fail and print the useage again. Is there a simple way to
> achieve this?
There are more experienced UNIXers here, but from my POV I don't see how