You can detect if the input is a terminal, which should tell you the corollary:
print 'pipe' unless -t; [download]
In reply to Re: Detect piped input by Loops in thread Detect piped input by igoryonya