1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/env python """Assert no TTY is available.""" import sys status = 0 for handle in sys.stdin, sys.stdout, sys.stderr: if handle.isatty(): print(f'{handle} is a TTY', file=sys.stderr) status += 1 sys.exit(status)