Python File isatty() Method
Example
Check if the file is connected to a terminal device:
f = open("demofile.txt", "r")
print(f.isatty())
Run Example »
Definition and Usage
The isatty() method returns
True if the file stream is interactive, example: connected to a terminal device.
Syntax
file.isatty()
Parameter Values
No parameters