学习Python有很长一段时间了,可是一直感觉都没有啥子明显的进示。最近想了想,还是觉得自己目标不够明确,不清楚到底学了后能做些什么(业余人士,学编程就是爱好),因此什么都在看,但却什么都没成。总结了下,确定在网络编程方面的深入一下,麻烦大家指教下需要学些什么样的东西。
回复内容:
Python网络编程是一个很大的范畴,个人感觉需要掌握的点有:1. 如何使用Python来创建socket, 如何将socket与指定的IP地址和端口进行绑定,使用socket来发送数据,接受数据,
2. 如何使用Python中处理线程,从而编写可以同时处理多个请求的web服务器
3. 如何使用Python来控制HTTP层的逻辑,包括如何创建http GET,POST,PUT,DELETE请求,如何处理接受到的HTTP请求,这些分别涉及python的httplib, basehttpserver等模块
4. 掌握一种基本的python的web开发框架,比如webpy, django,pylon
5. 了解非阻塞式的HTTP Server,比如tornado
6. 了解twisted, python编写的消息驱动的网络引擎
参考资料:
网络基础知识
1. HTTP: the definitive guide http://www.amazon.com/HTTP-Definitive-Guide-David-Gourley/dp/1565925092/
2. Computer Networking: A Top-Down Approach http://www.amazon.com/Computer-Networking-Top-Down-Approach-Edition/dp/0136079679/ref
python 网络编程基础
1. python 网络编程 http://www.amazon.com/Foundations-Python-Network-Programming-Goerzen/dp/1590593715
2. python socket编程的文档 http://docs.python.org/library/socket.html
3. python httplib的文档 http://docs.python.org/library/httplib.html
python常用框架文档:
1. django 的官方网站 https://www.djangoproject.com/
2. twisted 的官方网站 http://twistedmatrix.com/trac/
3. tornado 的官方网站 http://www.tornadoweb.org/ 就我个人的经验,不妨:
1.写出基本的TCP连接,知道编写TCP的各个步骤,例如创建socket、绑定port、端口复用等,对TCP稍微做了解,知道协议的每个字段,了解三次握手。
2.了解基本的服务器并发模型,例如多进程、多线程、IO复用
3.了解一些网络库例如twisted
其实想研究深入还得去读《UNP》《TCPv1》之类的书籍,但是这类语言都是基于C的。
我是在Linux下编写C++程序的,我的感觉是要钻研的深入,一般都是用C来描述,
用python这种语言,抽象层次高,容易抓住重点,适合上手,但是同时也规避了很多问题 一般来说分为web编程和网络编程,所以最好分清两者的概念。前者更倾向于去学习一些主流的框架以及自己搭建站点,后者则是从更底层上去描述与实现。所以建议先找到感兴趣的,在好好研究。 可以参考下面这个答案,这个答案对英语不好如何看技术英文文档的问题也有参考性,对照源码读http://docs.python.org/2/library/对英文有帮助。
<span class="n">__cutline_start__</span> <span class="o">=</span> <span class="s">'-'</span> <span class="o">*</span> <span class="mi">20</span> <span class="o">+</span> <span class="s">'以下转发赖勇浩的答案'</span> <span class="o">+</span> <span class="s">'-'</span> <span class="o">*</span> <span class="mi">20</span>
不清楚你具体指的是底层的网络编程,还是偏应用的web开发。如果是做网站的话,那是web开发,建议先去看python的web开发框架,推荐从Django开始,文档比较详细Django:https://www.djangoproject.com/ Socket Programming in Python这里有个简单的教程 我也在学,第一感觉是先学好英语 学习完网络编程基础知识后. 强烈建议学习twisted.

Python est une langue interprétée, mais elle comprend également le processus de compilation. 1) Le code Python est d'abord compilé en bytecode. 2) ByteCode est interprété et exécuté par Python Virtual Machine. 3) Ce mécanisme hybride rend Python à la fois flexible et efficace, mais pas aussi rapide qu'une langue entièrement compilée.

Usaforloopwheniterating aepasquenceorfor pourpascific inumberoftimes; useawhileloopwencontinTutuntutilaconditioniseMet.ForloopsareIdealForkNown séquences, tandis que celle-ci, ce qui est en train de réaliser des étages.

PythonloopscanleadtoerrorlikeInfiniteLoops, modificationlistDuringiteration, off-by-by-oneerrors, zéro-indexingisss et intestloopinefficisecy.toavoid this: 1) use'i

ForloopsAreAdvantageSousForkNowiterations et séquences, offrant laimplicité et la réadaptation;

Pythonusahybridmodelofcompilation et interprétation: 1) thepythoninterpreterCompileSourCodeIntOplatform-indépendantBytecode.2) thepythonvirtualmachine (pvm) there examenesthisbytecode, équilibrage de l'usage de la performance.

Pythonisbothinterpretedand compiled.1) il est composédToByteCodeForportabilityAcrosplatforms.2) theytecodeisthenter interprété, permettant à OrdayNamictypingAndRapidDevelopment, bien que MaybeSlowerSlowerSwower, aisance.

Forloopsareideal quand vous savez que l'immatriculation des adressages a une avance, tandis que ce qui est de savoir si

Forloopsaseesesed whenthenUmberoFitations dissownininadvance, tandis que celle-ci a été utilisé sur les éléments de la dispense


Outils d'IA chauds

Undresser.AI Undress
Application basée sur l'IA pour créer des photos de nu réalistes

AI Clothes Remover
Outil d'IA en ligne pour supprimer les vêtements des photos.

Undress AI Tool
Images de déshabillage gratuites

Clothoff.io
Dissolvant de vêtements AI

Video Face Swap
Échangez les visages dans n'importe quelle vidéo sans effort grâce à notre outil d'échange de visage AI entièrement gratuit !

Article chaud

Outils chauds

SublimeText3 version Mac
Logiciel d'édition de code au niveau de Dieu (SublimeText3)

Dreamweaver CS6
Outils de développement Web visuel

Version Mac de WebStorm
Outils de développement JavaScript utiles

PhpStorm version Mac
Le dernier (2018.2.1) outil de développement intégré PHP professionnel

mPDF
mPDF est une bibliothèque PHP qui peut générer des fichiers PDF à partir de HTML encodé en UTF-8. L'auteur original, Ian Back, a écrit mPDF pour générer des fichiers PDF « à la volée » depuis son site Web et gérer différentes langues. Il est plus lent et produit des fichiers plus volumineux lors de l'utilisation de polices Unicode que les scripts originaux comme HTML2FPDF, mais prend en charge les styles CSS, etc. et présente de nombreuses améliorations. Prend en charge presque toutes les langues, y compris RTL (arabe et hébreu) et CJK (chinois, japonais et coréen). Prend en charge les éléments imbriqués au niveau du bloc (tels que P, DIV),
