Check output device is a terminal: Difference between revisions
Content added Content deleted
m (added whitespace before the TOC (table of contents), added a ;Task: (bold) header.) |
(Added Python) |
||
Line 222: | Line 222: | ||
$ perl6 -e 'note $*OUT.t' >/dev/null |
$ perl6 -e 'note $*OUT.t' >/dev/null |
||
False</pre> |
False</pre> |
||
=={{header|Python}}== |
|||
Pretty much the same as [[Check input device is a terminal#Python]]. |
|||
<lang python>from sys import stdout |
|||
if stdout.isatty(): |
|||
print 'The output device is a teletype. Or something like a teletype.' |
|||
else: |
|||
print 'The output device isn\'t like a teletype.'</lang> |
|||
=={{header|Racket}}== |
=={{header|Racket}}== |