Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7393 > unrolled thread

Re: Question About Command line arguments

Started byTim Chase <python.list@tim.thechases.com>
First post2011-06-10 13:31 -0500
Last post2011-06-10 13:31 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Question About Command line arguments Tim Chase <python.list@tim.thechases.com> - 2011-06-10 13:31 -0500

#7393 — Re: Question About Command line arguments

FromTim Chase <python.list@tim.thechases.com>
Date2011-06-10 13:31 -0500
SubjectRe: Question About Command line arguments
Message-ID<mailman.93.1307730688.11593.python-list@python.org>
On 06/10/2011 12:58 PM, Mark Phillips wrote:
> How do I write my script so it picks up argument from the
> output of commands that pipe input into my script?

You can check

   if os.isatty(sys.stdin):  # <-- this check
     do_stuff_with_the_terminal()
   else:
     read_options_from_stdin()

-tkc


[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web