Python培训文档v1.pptxVIP

  • 6
  • 0
  • 约2.99千字
  • 约 11页
  • 2017-12-26 发布于河北
  • 举报
Python培训文档v1

Why python?Python是实验室里常用的一种编程语言《How To Become A?Hacker》Eric Steven RaymondLearn how to program.This, of course, is the fundamental hacking skill. If you don’t know any computer languages, I recommend starting with Python. It is cleanly designed, well documented, and relatively kind to beginners. Despite being a good first language, it is not just a toy; it is very powerful and flexible and well suited for large projects. I have written a more detailed?evaluation of Python. Good?tutorials?are available at the?Python web site?.咩?blah blah blah产生:Python的创始人为Guido van Rossum。1989年圣诞节期间,在阿姆斯特丹,Guido为了打发圣诞节的无趣,决心开发一个新的脚本解释程序,做为ABC 语言的一种继承。之所以选中Python(大蟒蛇的意思)作为程序的名字,是因为他是一个Monty Python的飞行马戏团的爱好者。Blah blah blah优点:简单、易学、免费、开源、高层语言、可移植性,解释性、面向对象、可扩展性、可嵌入性、丰富的库、规范的代码。局限性:强制缩进、单行语句和命令行输出问题、 运行速度、国内市场较小、中文资料匮乏Reference bookSomething useful/ivic/wiki/AptanaHowto/ivic/wiki/AptanaHowto///moin/PyAbsolutelyZipManual/moin/PyAbsolutelyZipManualBookIDEIDLEAptanaEclipseNotepad…Hello worldprint “Hello Python”examples:Useful tipsList [] append(xx),len(listname),[x1:x2], for each in listname;Dictionary(map) {key:value}dicName[key1]=value1;for eachkey,eachvalue in dicName;dicName.keys(),dicName.values()for(int i=0;in;i++) ? for i in range(n):return retv1,retv2,retv3; r1,r2,r3=function();var=raw_input() #readin as a string.Assignment作业由两个程序(客户端和服务器端)构成。服务器端监听某个端口,等待客户端连接。客户端连接到服务器以后,首先进行身份认证(用户名+密码),通过认证后客户端可以获取服务器某指定目录下的文件列表,然后客户端可以选择列表中的某个文件,将其下载至本地(仍然通过当前Socket连接)。其中,服务器地址、监听端口、用户名/密码以及指定目录均要求写在一个YAML配置文件中,由程序读取,不能在程序中写死。Hint/library/socketserver.html?highlight=server/library/socketserver.html?highlight=server#SocketServer.BaseServerYaml是第三方包,需要安装。可能用到的模块SocketServer,os,yamlIdle提供debug功能,简便的方法是直接插桩print某个变量。# 为注释,无多行注释中文编码问题,需要加# -*- coding: cp936 -*-QA简单:Python是一种代表简单主义思想的语言。阅读一个良好的Python程序就感觉像是在读英语一样。它使你能够专注于解决问题而不是去搞明白语言本身。 易学:Python极其容易上手,因为Python有极其简单的语法。 免费、开源:Python是FLOSS(自由/开放源码软件)之一。使用者可以自由地发布这个软件的拷贝、阅读它的源代码、对它做改动、把它的一部分用于新的自由软件中。FLOSS是基于一个团体分享知识的概念。 高层语言:用Python语言编写程序的时候无需考虑诸

文档评论(0)

1亿VIP精品文档

相关文档