Re: Invoking Unix commands from a Python app

2005-12-17 Thread Will McDonald
On 16 Dec 2005 08:45:01 -0800, Rob Cowie <[EMAIL PROTECTED]> wrote: > Excellent... just the thing I was looking for. Thanks. > > Does anyone know of a unix app that could be used to monitor the > duration of processes etc.? If you have control over starting the program then "time" will probaby suf

Testing for the presence of input from stdin.

2006-01-23 Thread Will McDonald
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. I can test for a file argument on the command line usin

Re: Testing for the presence of input from stdin.

2006-01-23 Thread Will McDonald
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

Re: Testing for the presence of input from stdin.

2006-01-24 Thread Will McDonald
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 > > s