python3学习手册
函数func_out()里的变量 str1 = str1 + " World" func_inner() return str1 if __name__ == "__main__": print(func_out()) 结果: Hello World ★第6章、python3内置函数 内置函数是指不用import导入任何模块就能直接使用的函数 包名x 下的__init__.py里的 __all__=[这里列出的函 数及变量] 一个模块被另一程序第一次导入时,其主程序将运行,若不想让它运 行,可做个判断: if __name__=="__main__": #被导入模块的主程序写这里,只有它自己执行时才运行这里的代码 else: #来自另一程序的调用 import sys as xx #将导入的模块名 tar.gz模块安装包一样打包我们的源代码并执行setup.py去安装我们 的代码模块,可以使用distu�ls模块里的setup函数去打包 例如,我们写的代码有cof.py及lee.py两个模块,main.py只是用于测试 的主函数 现在需要把cof.py及lee.py打包成一个安装包 在我们的源程序目录下再创建一个setup.py文件,内容如下: from distutils.core import0 码力 | 213 页 | 3.53 MB | 1 年前3Tornado 6.5 Documentation
Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s Python web frameworks. It is not based on WSGI, and it is typically run with only one thread per process. See the User’s guide for more on Tornado’s approach to asynchronous programming. While some support supported or recommended for pro- duction use. Some features are missing on Windows (including multi-process mode) and scalability is limited (Even though Tornado is built on asyncio, which supports Windows0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.4 Documentation
Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s Python web frameworks. It is not based on WSGI, and it is typically run with only one thread per process. See the User’s guide for more on Tornado’s approach to asynchronous programming. While some support supported or recommended for pro- duction use. Some features are missing on Windows (including multi-process mode) and scalability is limited (Even though Tornado is built on asyncio, which supports Windows0 码力 | 268 页 | 1.09 MB | 1 年前3Tornado 6.4 Documentation
Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s Python web frameworks. It is not based on WSGI, and it is typically run with only one thread per process. See the User’s guide for more on Tornado’s approach to asynchronous programming. While some support supported or recommended for pro- duction use. Some features are missing on Windows (including multi-process mode) and scalability is limited (Even though Tornado is built on asyncio, which supports Windows0 码力 | 268 页 | 1.09 MB | 1 年前3Tornado 6.4 Documentation
Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s Python web frameworks. It is not based on WSGI, and it is typically run with only one thread per process. See the User’s guide for more on Tornado’s approach to asynchronous programming. While some support supported or recommended for pro- duction use. Some features are missing on Windows (including multi-process mode) and scalability is limited (Even though Tornado is built on asyncio, which supports Windows0 码力 | 268 页 | 1.09 MB | 1 年前3Tornado 6.3 Documentation
Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s Python web frameworks. It is not based on WSGI, and it is typically run with only one thread per process. See the User’s guide for more on Tornado’s approach to asynchronous programming. While some support supported or recommended for pro- duction use. Some features are missing on Windows (including multi-process mode) and scalability is limited (Even though Tornado is built on asyncio, which supports Windows0 码力 | 264 页 | 1.06 MB | 1 年前3Tornado 6.2 Documentation
Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s Python web frameworks. It is not based on WSGI, and it is typically run with only one thread per process. See the User’s guide for more on Tornado’s approach to asynchronous programming. While some support supported or recommended for pro- duction use. Some features are missing on Windows (including multi-process mode) and scalability is limited (Even though Tornado is built on asyncio, which supports Windows0 码力 | 260 页 | 1.06 MB | 1 年前3Tornado 5.1 Documentation
world") def make_app(): return tornado.web.Application([ (r"/", MainHandler), ]) if __name__ == "__main__": app = make_app() app.listen(8888) tornado.ioloop.IOLoop.current().start() This example does not Python web frameworks. It is not based on WSGI, and it is typically run with only one thread per process. See the User’s guide for more on Tornado’s approach to asynchronous programming. While some support coroutine, and then stop the IOLoop with the IOLoop.run_sync method. This is often used to start the main function of a batch-oriented program: 5.1. User’s guide 15 Tornado Documentation, Release 5.1.10 码力 | 243 页 | 895.80 KB | 1 年前3Tornado 4.5 Documentation
make_app(): return tornado.web.Application([ (r"/", MainHandler), ]) if __name__ == "__main__": app = make_app() app.listen(8888) tornado.ioloop.IOLoop.current().start() This example http1connection – HTTP/1.x client/server implementation Asynchronous networking tornado.ioloop — Main event loop tornado.iostream — Convenient wrappers for non-blocking sockets tornado.netutil — Miscellaneous futures tornado.locks – Synchronization primitives tornado.queues – Queues for coroutines tornado.process — Utilities for multiple processes Integration with other services tornado.auth — Third-party login0 码力 | 333 页 | 322.34 KB | 1 年前3Tornado 6.1 Documentation
make_app(): return tornado.web.Application([ (r"/", MainHandler), ]) if __name__ == "__main__": app = make_app() app.listen(8888) tornado.ioloop.IOLoop.current().start() This example WSGI [https://wsgi.readthedocs.io/en/latest/], and it is typically run with only one thread per process. See the User’s guide for more on Tornado’s approach to asynchronous programming. While some support supported or recommended for production use. Some features are missing on Windows (including multi-process mode) and scalability is limited (Even though Tornado is built on asyncio, which supports Windows0 码力 | 931 页 | 708.03 KB | 1 年前3
共 522 条
- 1
- 2
- 3
- 4
- 5
- 6
- 53