How can I specify a file (or tty) attached to my stdios?
Sort of:
>>> import sys
>>> print sys.stdin.__path__
'/dev/tty1'
>>>
I could look in proc:
import os, sys
os.readlink('/proc/self/fd/%s' % sys.stdin.fileno())
But it looks like there should be an inline way?
source
share