本文整理汇总了Python中multiprocessing.connection.Client.recv_bytes_into方法的典型用法代码示例。如果您正苦于以下问题:Python Client.recv_bytes_into方法的具体用法?Python Client.recv_bytes_into怎么用?Python Client.recv_bytes_into使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类multiprocessing.connection.Client
的用法示例。
在下文中一共展示了Client.recv_bytes_into方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Client
# 需要导入模块: from multiprocessing.connection import Client [as 别名]
# 或者: from multiprocessing.connection.Client import recv_bytes_into [as 别名]
from multiprocessing.connection import Client
from array import array
address = ('localhost', 6000)
conn = Client(address, authkey='secret password')
print conn.recv() # => [2.25, None, 'junk', float]
print conn.recv_bytes() # => 'hello'
arr = array('i', [0, 0, 0, 0, 0])
print conn.recv_bytes_into(arr) # => 8
print arr # => array('i', [42, 1729, 0, 0, 0])
conn.close()
示例2: Client
# 需要导入模块: from multiprocessing.connection import Client [as 别名]
# 或者: from multiprocessing.connection.Client import recv_bytes_into [as 别名]
# coding=utf8
"""
Created on 2015年3月6日
@author: sanhe
"""
from multiprocessing.connection import Client
from array import array
address = ("localhost", 6000)
conn = Client(address, authkey="secret password")
print conn.recv()
print conn.recv_bytes()
arr = array("i", [0, 0, 0, 0, 0])
print conn.recv_bytes_into(arr)
print arr
conn.close()