Python web 模块,py() 实例源码

我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用web.py()

项目:argparseweb    作者:nirizr    | 项目源码 | 文件源码
def get(self, count=True):
    # prepare a process-safe queue to hold all results
    results = multiprocessing.Queue()

    # spawn web.py server in another process, have it's dispatch as queue.put method
    app = self.app(dispatch=results.put, parsed=True)
    t = multiprocessing.Process(target=app.run)
    t.start()

    # stop condition: if count is a number decrease and loop until 0,
    #   if count is True, loop forever
    while count:
      yield results.get()

      if type(count) == int:
        count -= 1

    app.stop()
    t.terminate()
项目:oa_qian    作者:sunqb    | 项目源码 | 文件源码
def _make_response(self, content, headers, status):
        return content

# web.py implementation