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 but > > can't think how to test for stdin. > > maybe http://docs.python.org/lib/module-fileinput.html is useful for you:
That looks ideal, I'll have a play with it to see how it behaves in conjunction with getopt. Thanks Roland. Thanks Peter and Diez for your input too. Will. -- http://mail.python.org/mailman/listinfo/python-list