os.openpty()
NA
# !/usr/bin/python3 import os # master for pty, slave for tty m,s = os.openpty() print (m) print (s) # showing terminal name s = os.ttyname(s) print (m) print( s)
3 4 3 /dev/pty0