Comments on: HOW TO detect STDIN with Python https://www.popmartian.com/tipsntricks/2011/07/25/how-to-detect-stdin-with-python/ Carpe Crap 'em Wed, 21 Oct 2026 14:52:32 +0000 hourly 1 https://wordpress.org/?v=6.9.10 By: admin https://www.popmartian.com/tipsntricks/2011/07/25/how-to-detect-stdin-with-python/comment-page-1/#comment-53112 Tue, 29 Jan 2013 17:37:44 +0000 http://www.popmartian.com/tipsntricks/?p=214#comment-53112 In reply to Rufus.

Thanks! I’ll test and update the post.

]]>
By: Rufus https://www.popmartian.com/tipsntricks/2011/07/25/how-to-detect-stdin-with-python/comment-page-1/#comment-53109 Tue, 29 Jan 2013 16:51:12 +0000 http://www.popmartian.com/tipsntricks/?p=214#comment-53109 instead of:
os.isatty(file.fileno(sys.stdin))
use:
sys.stdin.isatty()

It is probably moot, but the first version threw a TypeError when run within IDLE.

]]>