def open(self, target):
# target is a character device
if os.path.exists(target) \
and stat.S_ISCHR(os.stat(target).st_mode):
self._file = os.open(target, os.O_RDWR)
# treat target as ipv4 socket
else: self._sock.connect((target, 9100))
# close connection
评论列表
文章目录