Python Forum
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
detect if sys.stdin is ...
#1
how to detect if sys.stdin is the controlling tty (as opposed to a pipe, or a socket, or a file, or "/dev/null", or some other tty the script was invoked to read from)? is there an equivalent in windows?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
detect if sys.stdin is ... - by Skaperen - May-28-2018, 03:34 AM
RE: detect if sys.stdin is ... - by ljmetzger - May-30-2018, 04:10 AM
RE: detect if sys.stdin is ... - by Skaperen - May-30-2018, 06:39 AM
RE: detect if sys.stdin is ... - by ljmetzger - May-30-2018, 01:18 PM
RE: detect if sys.stdin is ... - by Skaperen - May-30-2018, 11:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  When is stdin not connected to a tty, but can still be used interactively? stevendaprano 1 1,017 Sep-24-2022, 05:06 PM
Last Post: Gribouillis
  STDIN not working H84Gabor 3 3,591 Sep-06-2021, 08:10 AM
Last Post: H84Gabor
  How to read a file using stdin? pyth0nus3r 1 2,846 Aug-24-2019, 01:14 AM
Last Post: Larz60+
  What is the sys.stdin.isatty() command? pyth0nus3r 2 11,468 Aug-22-2019, 04:37 PM
Last Post: pyth0nus3r
  getting error "exec_proc.stdin.write(b'yes\n') IOError: [Errno 32] Broken pipe" Birju_Barot 0 2,945 Jul-23-2019, 11:50 AM
Last Post: Birju_Barot
  is it safe to close stdin Skaperen 1 2,680 Apr-04-2019, 06:57 AM
Last Post: Gribouillis
  Need help with reading input from stdin into array list Annie123 2 5,079 Mar-24-2019, 01:19 PM
Last Post: Annie123
  storing lines from stdin in a list bghosh 2 2,996 May-02-2018, 01:12 PM
Last Post: gruntfutuk
  How can I use GNU readline when the value of sys.stdin has been changed? thePhysicist8 6 7,112 Dec-30-2016, 10:09 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020