w*s 发帖数: 7227 | 1 【 以下文字转载自 Linux 讨论区 】
发信人: wds (网虫都是loser), 信区: Linux
标 题: how can python code wait for signal from a c code program ?
发信站: BBS 未名空间站 (Mon Jul 29 21:30:13 2013, 美东)
hi we have a program from c code, it uses named pipe,
then use select() to wait on it,
basically if someone writes data into this pipe,
we'll catch it with select() (not 100% sure, but sth. like this)
normally another c code process can catch this and reports we get data.
i want to replace it with python, how can i do that ?
i mean how can i wait for this write-to-pipe signal ?
many thanks !h | r****t 发帖数: 10904 | 2 simply open the pipe and loop over the iterator. it blocks and waits for
other processes to write.
【在 w*s 的大作中提到】 : 【 以下文字转载自 Linux 讨论区 】 : 发信人: wds (网虫都是loser), 信区: Linux : 标 题: how can python code wait for signal from a c code program ? : 发信站: BBS 未名空间站 (Mon Jul 29 21:30:13 2013, 美东) : hi we have a program from c code, it uses named pipe, : then use select() to wait on it, : basically if someone writes data into this pipe, : we'll catch it with select() (not 100% sure, but sth. like this) : normally another c code process can catch this and reports we get data. : i want to replace it with python, how can i do that ?
|
|