我正在寻找一个 Python 类:
- Python 2.7 支持
- 充当具有独立读写指针的内存管道
- 是线程安全的
- 理想情况下,具有类似于常规文件对象的方法(
read
、write
等) - 理想情况下已经在 Python 标准库中或者至少可以从 pip 访问
这样的生物存在吗?也许是 BufferedRWPair
,但它的文档很悲惨:
https://docs.python.org/2/library/io.html#io.BufferedRWPair
最佳答案
原来我在找https://docs.python.org/2/library/os.html#os.mkfifo .它完全符合我的需要。
关于multithreading - Python 类管道流对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24796062/