擅长:python、mysql、java
<p>签出<a href="http://zeromq.org/bindings:python" rel="nofollow"><strong>^{<cd1>}</strong></a>。它可以像超级电源插座一样点对点地使用,并且在代码中看起来很漂亮和干净,就像您的示例一样。<a href="http://learning-0mq-with-pyzmq.readthedocs.io/en/latest/pyzmq/patterns/client_server.html" rel="nofollow"><strong>This</strong> example</a>显示了它是多么容易。</p>
<p>或者,您可以在服务器端使用像<a href="http://bottlepy.org/docs/dev/index.html" rel="nofollow"><strong>^{<cd3>}</strong></a>或<a href="http://flask.pocoo.org/" rel="nofollow"><strong>^{<cd4>}</strong></a>这样的轻量级web服务框架来完成一个简单的<code>REST</code>接口。为了便于使用,它们可以单独运行,然后放在web服务器后面(例如,<a href="https://nginx.org/en/docs/" rel="nofollow"><strong>^{<cd5>}</strong></a>和<a href="https://uwsgi-docs.readthedocs.io/en/latest/" rel="nofollow"><strong>^{<cd6>}</strong></a>)以提高性能。在客户端,用普通的python<a href="http://docs.python-requests.org/en/master/" rel="nofollow">requests module</a>与之交谈。</p>