大家好,今天小编关注到一个比较有意思的话题,就是关于python web 开发学习实录的问题,于是小编就整理了1个相关Python web 开发学习实录的解答,让我们一起看看吧。
如何开发一个Pythonweb框架?
预备知识
web框架主要是实现web服务器和web应用之间的交互。底层的网络协议主要有web服务器完成。譬如监听端口,填充报文等等。
(图片来源网络,侵删)
Python内建函数__iter__和__call__和WSGI
迭代器iterator
为类序列对象提供了类序列的接口,也就是说类序列对象可以通过迭代器像序列一样进行迭代。
(图片来源网络,侵删)
__call__
在类定义的时候实现了__call__方法,那么该类的对象就是可调有的,即可以将对象当做函数来使用。
WSGI
(图片来源网络,侵删)
用可调用的对象实现的:一个函数,一个方法或者一个可调用的实例。
到此,以上就是小编对于python web 开发学习实录的问题就介绍到这了,希望介绍关于python web 开发学习实录的1点解答对大家有用。