 |
 |
 |
Python库参考手册(Python Library Reference) |
 |
 |
11.1.2 端口对象 Port Objects
Port objects, as returned by openport(), have the following
methods:
端口对象由调用 openport() 得到, 它有以下方法:
-
Close the port. 关闭端口。
-
Return the file descriptor as an int. 传回描述档案的整数值。
-
Return the number of filled samples. 传回已取得值的样本的数目。
-
Return the number of fillable samples. 传回可以取值的样本的数目。
-
Read a number of samples from the queue, blocking if necessary.
Return the data as a string containing the raw data, (e.g., 2 bytes per
sample in big-endian byte order (high byte, low byte) if you have set
the sample width to 2 bytes).
从队列中读取一定数目的样本,以等候态直至读取完毕。 传回代表原始数据的字符串,
(例如, 如你设定取样宽度为两个位元的话, 则每个样本以双字元大顺位次序存放
(高字元, 低字元)).
-
Write samples into the queue, blocking if necessary. The samples are
encoded as described for the readsamps() return value.
把样本写到队列中去, 以等候态直至写完。 样本的编码方式以 readsamps()
函数的传回值所描述的一样。
-
Return the `fill point'. 传回 "填入点 fill point".
-
Set the `fill point'. 设置 “填入点 fill point".
-
Return a configuration object containing the current configuration of
the port.
传回一个配置对象, 其中包含了目前端口的配置。
-
Set the configuration from the argument, a configuration object.
用引数, 一个配置对象来设置端口。
-
Get status information on last error.
取得最近一次错误的状态资料。
 |
 |
 |
Python库参考手册(Python Library Reference) |
 |
 |
版本 2.3.3, 文件最后更新时间 译文最后修改: 三月 22, 2004.