()
Returns piped input via stdin, else None.
Returns piped input via stdin, else None.
Returns piped input via stdin else None .
def piped_in():
    """Returns piped input via stdin, else None."""
    with sys.stdin as stdin:
        # TTY is only way to detect if stdin contains data
        if not stdin.isatty():
            return stdin.read()  
        else:
            return None
def piped_in ( ) : with sys . stdin as stdin : # TTY is only way to detect if stdin contains data if not stdin . isatty ( ) : return stdin . read ( ) else : return None