Check output device is a terminal: Difference between revisions
Check output device is a terminal (view source)
Revision as of 23:30, 21 September 2016
, 7 years agoAdded Python
m (added whitespace before the TOC (table of contents), added a ;Task: (bold) header.) |
(Added Python) |
||
Line 222:
$ perl6 -e 'note $*OUT.t' >/dev/null
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}}==
|