Python论坛  - 讨论区

标题:[zeuux-python] [karrigell] Karrigell + PyProcessing, Very good and Strong!

2008年08月24日 星期日 20:18

Zoom.Quiet zoom.quiet在gmail.com
星期日 八月 24 20:18:03 CST 2008

this is very very great try!
Collected into woodpecker.org.cn's wiki, sharing and enjoy this enhancement!

http://wiki.woodpecker.org.cn/moin/KarrigellWithPyProcessingVeryGoodStrong


On Sat, Aug 23, 2008 at 18:14, ccnusjy <ccnusjy在gmail.com> wrote:
>
> import os
> import traceback
> import sys
>
> import KarrigellRequestHandler
> import k_config, k_utils
> import webservers.SimpleAsyncHTTPServer as Server
> from processing import Process, currentProcess, freezeSupport
> if sys.platform == 'win32':
>    import processing.reduction    # make sockets pickable/inheritable
>
> class
> asyncRequestHandler(KarrigellRequestHandler.KarrigellRequestHandler,
>        Server.DialogManager):
>
>    def handle_data(self):
>
> KarrigellRequestHandler.KarrigellRequestHandler.handle_data(self)
>
>    def send_error(self, code, message=None):
>
> KarrigellRequestHandler.KarrigellRequestHandler.send_error(self,
>            code,message)
>
>    def handle_error(self):
>        traceback.print_exc(file=sys.stderr)
>
> def kkk_serve(s):
>    #print k_config.silent
>    #if k_config.silent:
>    sys.stdout = k_utils.silent()
>    sys.stderr = k_utils.silent()
>    try:
>        s.loop()
>    except KeyboardInterrupt:
>        s.close_all()
>        k_utils.trace("Ctrl+C pressed. Shutting down.")
>
> def main_start():
>    # Launch the server
>    port = 8086
>    process_num = 3
>
>    s = Server.Server(('localhost',port),asyncRequestHandler)
>
>    print "Karrigell %s running on port %s" %
> (KarrigellRequestHandler.__version__,
>        port)
>    print "Press Ctrl+C to stop"
>
>    for i in range(process_num):
>        child = Process(target=kkk_serve, args=(s,))
>        child.setDaemon(True)
>        child.start()
>
>    kkk_serve(s)
>
> if __name__ == '__main__':
>    if sys.platform == 'win32':
>        freezeSupport()
>    main_start()
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "karrigell" group.
> To post to this group, send email to karrigell在googlegroups.com
> To unsubscribe from this group, send email to karrigell+unsubscribe在googlegroups.com
> For more options, visit this group at http://groups.google.com/group/karrigell?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
>





-- 

http://zoomquiet.org'''
过程改进乃是催生可促生靠谱的人的组织!
PE keeps evolving organizations which promoting people be good!'''

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2024

    京ICP备05028076号