问题描述
我希望有一个用Python编写的MML(人机语言)控制台作为控制和监视后端进程的唯一入口点。基本上将能够:- 附加到现有的后端进程
- 自动完成允许的命令
/>>
这将是最好的方法来实现这一点?如何使用可以打开和关闭而不会杀死后端进程的控制台传达后端进程,这是我的意思是控制台不会是该进程的父进程。
需要用Python编写,并在CentOS上运行,也许一些操作系统工具可以帮助沟通过程?
我的列表中的高度为。建立非常容易而且它是系统可能会适合您。此外,它非常强大,具有快速的事件循环,而且非常强大。
您还可以使用模组,最近在Doug Hellmann的优秀网站。
对于进程间通信,是相当容易使用,它的速度非常快。
I am looking to have a MML (man machine language) console written in Python as the only entry point to control and monitor a back-end process. Basically will be able to:
- attach to an existing back-end process
- if back-end process is not running, still open console and be able to spawn back-end process (by introducing the correct command)
- auto-complete permitted commands
- be able to change back-end process behavior based on the introduced commands
What would be the best way to achieve this? How to communicate the back-end process with a console that can be opened and closed without killing the back-end process, by this I mean that the console would not be the parent of that process.
Needs to be written in Python and will run on a CentOS, maybe some OS tools can help to communicate processes?
High on my list would be twisted. It's fairly easy to build a an interactive console with and it's Perspective Broker system would probably work well for you. Plus it's very robust, has a fast event loop, and it's very robust.
You could also use the cmd module, which was recently featured on Doug Hellmann's excellent site Python Module of the Week (PyMOTW).
For interprocess communication, ZeroMQ is fairly easy to work with, and it's very fast.
这篇关于基础知识在Python中创建一个MML控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!