Created
March 17, 2014 05:32
-
-
Save jquast/9594450 to your computer and use it in GitHub Desktop.
osx pty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python 2.7.6 (default, Jan 21 2014, 22:43:59) | |
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import pty, os, termios | |
>>> master, slave = pty.openpty() | |
>>> master, slave | |
(3, 4) | |
>>> termios.tcgetattr(master) | |
[11010, 3, 19200, 1483, 9600, 9600, ['\x04', '\xff', '\xff', '\x7f', '\x17', '\x15', '\x12', '\xff', '\x03', '\x1c', '\x1a', '\x19', '\x11', '\x13', '\x16', '\x0f', '\x01', '\x00', '\x14', '\xff']] | |
>>> termios.tcgetattr(slave) | |
[11010, 3, 19200, 1483, 9600, 9600, ['\x04', '\xff', '\xff', '\x7f', '\x17', '\x15', '\x12', '\xff', '\x03', '\x1c', '\x1a', '\x19', '\x11', '\x13', '\x16', '\x0f', '\x01', '\x00', '\x14', '\xff']] | |
>>> os.isatty(master) | |
True | |
>>> os.isatty(slave) | |
True | |
>>> os.ttyname(slave) | |
'/dev/ttys001' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment