SlideShare ist ein Scribd-Unternehmen logo
1 von 45
Python 内部培训 Leejd80@gmail.com
Python面世 1989年,Guido van Rossum在阿姆斯特丹完成 Guido为了打发圣诞节的无趣,决心开发一个新的脚本解释程序,做为ABC语言的一种继承 第一个Python实现是运行在Mac机 使用Python作为语言的名字,因为是英国幽默剧团:"Monty Python飞行马戏团"的fans ABC是由Guido参加设计的一种教学语言非常优美和强大,是专门为非专业程序员设计的 目前在Google,主要从事GAE/Python3.x方面的研究
江湖地位(TIOBE Dec 2010)
Python的应用领域 桌面GUI软件开发(wxPython,PyQT…) 网络应用开发(内置模块,Twistd,Stackless…) 2/3D图形处理,游戏开发 (PIL,pyGame…) 文档处理,科学计算(moinmoin,numpy…) Web应用开发(Django,ZOPE,web.py,Quixote…) 移动设备应用开发(PyS60,PySide…) 数据库开发(支持SQL和NOSQL,ZODB…) 嵌入其它应用(嵌入C/C++,delphi,调用DLL…)
Python电影情节 工业光魔:http://www.ilm.com 电影特技:《侏罗纪公园》、《变形金刚》、《哈利波特》、《阿凡达》、《星球大战》等 工作站:Linux、IRIX、OS X、Windows、Tru64、Solaris等 Python 1.4(1996年),1.5,2.1 混合使用 主要用来控制和调度各个渲染的机器(maya) 了解更多:http://www.slideshare.net/stingchen/industrial-light-magic-success-story-case-study-iv-python-based-company
适合学习对象 软件开发人员 软件测试人员 软件配置/部署/自动化开发人员 网站运维人员 高级动画设计人员 系统原型架构设计人员
除了OS和驱动程序 Python 还有什么不能干的!
内部实现方式 C -- CPython我们现在使用的/官方发行的 JAVA -- Jythonjava项目中会使用 .NET -- IronPython Python -- pypy Parrot
蟒之禅(Python哲学) 优美胜过丑陋  明确胜过含蓄  简单胜过复杂  复杂胜过难懂  扁平胜过嵌套  稀疏胜过密集
开发环境 IDLE – 安装包自带,交互模式 UliPad – limodou基于wxPython写的,推荐! Eclipse+pydev – 收费的 Eric4 – 基于PyQT4,功能强大 BOA  – 类似于delphi的IDE(wxPython) WingIDE	 – 共享软件  VIM、Emacs – 主要在linux下使用 Bpython – linux的带提示的交互环境 其它编辑器 		UE,notepad++,editplus…
语法特色 动态语言特性 — 可在运行时改变对象本身(属性和方法等) 基于C/C++和JAVA,但有很大区别 缩进方式,建议使用空格,不要用TAB 多个语句在一行使用;分隔 注释符是#,多行使用docstring(’’’…’’’) 变量无需类型定义 可进行函数式编程FP Python3.x的变迁
本讲义约定使用Python 2.x版本 3.x版本由于库没有跟上,暂时不推荐使用
Hello world (1) 表达式 2 + 3 3 + (7 * 4) 3 ** 5 ‘Hello’ + ‘World’ 变量赋值 a = 4 << 3 b = a * 4.5 c = (a+b)/2.5 a = “Hello World” x,y = 4+2,”python” pass 语句– 不做任何事时使用 if a < b: 	pass else: 	c = a
Hello world (2) if…elif…else语句:  没有switch,有更高级的变通方式(dict字典方式) if a == ‘+’: 	b = ‘+’ elif a == ‘-’: 	b = ‘-’ else: 	b = None 布尔表达式– and, or, not if b >= a and b <= c: 	print ‘bool is True’ if not (b < a or c > c): 	print ‘not expr, value is True’
None Python特有的空值表示 与C/C++中的NULL是不同的 函数没有明确返回的话,默认返回是None 不能与其它类型进行运算
字符串string str[::], str[0], str[1:2], str[-1:] find/index()	  #没有找到子串,前者不会扔出异常 replace(),split(),strip() “sub” in	“str”		    #是否存在子串 join()>>>lst = [‘1’, ’2’, ’abc’, ’4’, ’5’]>>>‘,’.join(lst)‘1,2,abc,4,5’
强大的string处理案例 我原先的一个项目中,要根据业务逻辑来封装字符串操作,简化调用。 开始的时候使用的是C++写的字符串操作,整个类下来需要1500行代码。 改用Python之后,用了不到100行就实现了C++版本的所有功能并有所增强。
列表list 赋值 a = [2, 3, 4]		     # A list of integer b = [2, 7, 3.5, “Hello”]     # A mixed list c = []			     # An empty list d = [2, [a, b]]		     # 嵌套列表 e = a + b			     # Join two lists 操作 x = a[1] 		# Get 2nd element (0 is first) y = b[1:3] 	# Return a sub-list z = d[1][0][2] 	# Nested lists b[0] = 42 		# Change an element print sum(a)	# = 9 x = a.pop(0)	# pop第一个数据
tuple 赋值 f = (2,3,4,5) 		# A tuple of integers g = (,) 			# An empty tuple h = (2, [3,4], (10,11,12))# A tuple containing mixed objects 操作 x = f[1] 		# Element access. x = 3 y = f[1:3] 		# Slices. y = (3,4) z = h[1][1] 	# Nesting. z = 4 特色 与list类似,最大的不同tuple是一种只读且不可变更的数据结构 不可取代tuple中的任意一个元素,因为它是只读不可变更的,也不能进行像list一样的加法操作
字典dict 赋值 a = { } 			# An empty dictionary b = { ’x’: 3, ’y’: 4 }#有点类似json格式 c = { ’uid’: 105, 	   ’login’: ’beazley’, 	   ’name’ : ’David Beazley’ 	 } 操作 u = c[’uid’] 		# Get an element c[’shell’] = "/bin/sh" 	# Set an element dict2 = dict2.update(dict1) #使用dict1中的数据去更新dict2 if c.has_key("directory"): 	# Check for presence of an member d = c[’directory’] else: 	d = None d = c.get(“directory”,None) # 带默认值的方式
集合set >>> set( [“hello”, “world”, “of”, “words”, “of”, “world”] )set(['world', 'hello', 'words', 'of']) 如何删除重复数据 Ls1 = [1,3,5,3,7,4,5] Ls2 = list(set(Ls1)) 可以使用&、|求两个set的交集、并集、补集、全集s1 = set([1,2,3])s2 = set([2,4])s1 & s2		#{2} s1 | s2		#{1,2,3,4} s1 - s2		#{1,3}s1 ^ s2		#{1,3,4}
循环 While语句 while a < b: 	a = a + 1 	break For语句(遍历序列的元素) for item in [3, 4, 10, 25]: 	print item # Print characters one at a time for c in "Hello World": 	print c # Loop over a range of numbers for i in xrange(0,100,2): 	print i for i in xrange(len(list1)): 	print list1[i]
死循环怎么办? 桌面应用可以马上知道,并杀死对应进程 服务器应用怎么去监控? 计数器:在循环的最里面计数,超过指定数值就退出,缺点太多了 让函数带有超时功能
函数 def语句 def func1(a,b):#没有指针,函数内的数据只能通过返回 q = a/b 	r = a - q*b 	return r # 调用方式 a = func1(42,5) 		# a = 2 返回多个值 def func2(a,b): 	q = a/b 	r = a - q*b 	return q,r x,y = func2(42,5) 	# x = 8, y = 2
类class class语句 class Account: 	def __init__(self, initial): self.balance = initial 	def deposit(self, amt): self.balance = self.balance + amt 	def withdraw(self,amt): self.balance = self.balance – amt 	def getBalance(self): 		return self.balance 使用定义好的class a = Account(1000.0) a.deposit(550.23) a.deposit(100) a.withdraw(50) print a.getBalance()
异常处理 try语句 try: 	f = open(“foo“,”r”) except IOError: 	print "Couldn’t open ’foo’. Sorry.“ raise语句 def factorial(n): 	if n < 0: 		raise ValueError,"Expected non-negative number" 	if (n <= 1):  		return 1 	else:  		return n*factorial(n-1) 沒有处理的异常 >>> factorial(-1) Traceback (innermost last): 	File "<stdin>", line 1, in ? 	File "<stdin>", line 3, in factorial ValueError: Expected non-negative number
文件操作 open()函数 f = open("foo","w") 	# Open a file for writing g = open("bar","r") 	# Open a file for reading 文件的读取/写入 f.write("Hello World") buff = g.read() 		# Read all data line = g.readline() 	# Read a single line lines = g.readlines() 	# Read data as a list of lines with do			# py2.6以后版本提供 格式化的输入输出 使用%来格式化字符串 for i in range(0,10): f.write("2 times %d = %d" % (i, 2*i))
目录操作 把path1目录下面的*.html更名为*.htm for root,dirs,files in os.walk(path1): for item in files: if item[-5:].upper() != '.HTML‘:	continue filename = os.sep.join([root,item])         print filename         file1 = filename[:-5]+'.htm' os.rename(filename, file1)
匿名函数 lambda 从 Lisp 语言借用来的,只是一种风格,可用函数替换 >>> def func(x): ... return x*2  >>> func(3) 6  >>> g = lambda x: x*2  >>> g(3)  6  >>> (lambda x: x*2)(3)  6 请对下列数组进行排序 (先x再y,类似于SQL中的order by x,y) list1 = [{'x':1,'y':100},{'x':30,'y':50},{'x':0,'y':0},{'x':60,'y':90},{'x':30,'y':28}] sorted(list1, lambda a,b:cmp((a['x'],a['y']),(b['x'],b['y'])))
字符编码 Python2.x默认的是OS的本地编码 Python3.x是unicode内部编码 .py文件第一行:#coding=utf-8,不指定编码时,文件中包含非ASCII字符会报错 s1 = "中文1" s2 = u"中文2" print unicode(s1,'utf-8').encode('gbk') print s2.encode('gbk') print type(unicode(s1,'utf-8')),type(s2),type(s2.encode('gbk'))
指针?引用? Python里面没有指针 所有都是对象 对象之间都是引用(引用计数方式) 常用的对象都有cache 默认是浅拷贝,深拷贝代码:str[::] import copy  ls1 = [1,”test”,(3.4,7),{“key”:1, “comment”:”your comment”}] ls2 = copy.deepcopy(ls1)
正则表达式 导入模块: import rep = re.compile('ab*', re.IGNORECASE)p = re.compile('[a-z]+') match()函数只检测是不是在string的开始位置,只有在0位置匹配成功的话才有返回,如果不是开始位置匹配成功的话,match()就返回None。 search()会扫描整个string查找匹配
单元测试 unittest模块中的TestCase 类代表测试用例 TestCase类的实例是可以完全运行测试方法 可选的设置 (set-up)以及清除(tidy-up)代码的对象 TestCase实例的测试代码,可以单独运行或与其它任意数量的测试用例共同运行 简单测试用例 import unittest class DefaultWidgetSizeTestCase(unittest.TestCase): 	 	def runTest(self): 	    widget = Widget("The widget") 	    assert widget.size() == (50,50), 'incorrect  size'
性能优化 Python的开发效率很高 Python的执行效率很低,比C++和JAVA都慢 循环/函数调用等很消耗资源 数据结构的性能很高,目前可以认为是优化到极致 优化方式: 用timeit分析之后优化对应代码 使用psyco做JIT加速 Hash算法来替代某些常规语句 使用C模块来替换业务热点 部分地方可以使用map来替代for …in…循环 字符串少用+操作,特别是连续+ 不要迷恋语言性能,业务性能才是关键!
map/reduce 云计算的核心算法 ,[object Object]
Reduce则将每个小任务的计算结果进行收集和汇总
输出大任务的最终结果。Python中的代码,是不是有点云计算的味道? >>> seq = range(8) >>> zip(seq, map(lambda x:x*x, seq)) [(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25), (6, 36), (7, 49)] >>> reduce(lambda x,y:x+y, xrange(1, 11)) 55
调用系统命令 os.system(), os.spawn*, os.popen*, popen2.* 	A、新起一个shell去干活的,对系统的开销比较大 	B、获得输出等信息比较麻烦,不能与外部命令或工具交互 C、主进程无法控制,调用进程会block commands  易获得外部命令的输出 B、C subprocess  	Python2.6以后版本提供 解决上述模块不足
getattr/setattr Python的类继承 动态方式调用基类函数 使用dir(f)可以看到属性: im_class,im_func, im_self
模块 程序可分成好几个模块:一个py文件就是一个模块;目录下面增加__init__.py也是 # numbers.py def divide(a,b): 	q = a/b 	r = a - q*b 	return q,r def gcd(x,y): 	g = y 	while x > 0: 		g = x 		x = y % x 		y = g 	return g ,[object Object],import numbers x,y = numbers.divide(42,5) n = numbers.gcd(7291823, 5683) ,[object Object]
动态载入模块
一个模块只载入一次
实例会继承新加载的模块,[object Object]
动态调用 – 执行 Owner为厂家名称 device为厂家旗下的设备。 如果找不到设备的.py文件,则去调用厂家的.py #调用指定目录下的pana/bm123.py mod = loadModule(“pana”, “bm123”) if not mod:return obj = mod.Smt() obj.xxxx()
如何进行python开发呢?

Weitere ähnliche Inhalte

Was ist angesagt?

Python fundamentals - basic | WeiYuan
Python fundamentals - basic | WeiYuanPython fundamentals - basic | WeiYuan
Python fundamentals - basic | WeiYuanWei-Yuan Chang
 
Introduction to NumPy for Machine Learning Programmers
Introduction to NumPy for Machine Learning ProgrammersIntroduction to NumPy for Machine Learning Programmers
Introduction to NumPy for Machine Learning ProgrammersKimikazu Kato
 
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning LibrariesPython - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning LibrariesAndrew Ferlitsch
 
Python3 cheatsheet
Python3 cheatsheetPython3 cheatsheet
Python3 cheatsheetGil Cohen
 
High-Performance Haskell
High-Performance HaskellHigh-Performance Haskell
High-Performance HaskellJohan Tibell
 
Python Cheat Sheet
Python Cheat SheetPython Cheat Sheet
Python Cheat SheetGlowTouch
 
Monad presentation scala as a category
Monad presentation   scala as a categoryMonad presentation   scala as a category
Monad presentation scala as a categorysamthemonad
 
Scala - where objects and functions meet
Scala - where objects and functions meetScala - where objects and functions meet
Scala - where objects and functions meetMario Fusco
 
Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)stasimus
 
Real World Haskell: Lecture 5
Real World Haskell: Lecture 5Real World Haskell: Lecture 5
Real World Haskell: Lecture 5Bryan O'Sullivan
 
Declarative Thinking, Declarative Practice
Declarative Thinking, Declarative PracticeDeclarative Thinking, Declarative Practice
Declarative Thinking, Declarative PracticeKevlin Henney
 
Cheat sheet python3
Cheat sheet python3Cheat sheet python3
Cheat sheet python3sxw2k
 
Diving into byte code optimization in python
Diving into byte code optimization in python Diving into byte code optimization in python
Diving into byte code optimization in python Chetan Giridhar
 
Haskell for data science
Haskell for data scienceHaskell for data science
Haskell for data scienceJohn Cant
 
Exploring slides
Exploring slidesExploring slides
Exploring slidesakaptur
 
Mementopython3 english
Mementopython3 englishMementopython3 english
Mementopython3 englishssuser442080
 

Was ist angesagt? (20)

Python fundamentals - basic | WeiYuan
Python fundamentals - basic | WeiYuanPython fundamentals - basic | WeiYuan
Python fundamentals - basic | WeiYuan
 
Introduction to NumPy for Machine Learning Programmers
Introduction to NumPy for Machine Learning ProgrammersIntroduction to NumPy for Machine Learning Programmers
Introduction to NumPy for Machine Learning Programmers
 
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning LibrariesPython - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning Libraries
 
Python3 cheatsheet
Python3 cheatsheetPython3 cheatsheet
Python3 cheatsheet
 
High-Performance Haskell
High-Performance HaskellHigh-Performance Haskell
High-Performance Haskell
 
Python Cheat Sheet
Python Cheat SheetPython Cheat Sheet
Python Cheat Sheet
 
Monad presentation scala as a category
Monad presentation   scala as a categoryMonad presentation   scala as a category
Monad presentation scala as a category
 
Scala - where objects and functions meet
Scala - where objects and functions meetScala - where objects and functions meet
Scala - where objects and functions meet
 
iPython
iPythoniPython
iPython
 
Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)Introduction to Monads in Scala (2)
Introduction to Monads in Scala (2)
 
Real World Haskell: Lecture 5
Real World Haskell: Lecture 5Real World Haskell: Lecture 5
Real World Haskell: Lecture 5
 
Declarative Thinking, Declarative Practice
Declarative Thinking, Declarative PracticeDeclarative Thinking, Declarative Practice
Declarative Thinking, Declarative Practice
 
Cheat sheet python3
Cheat sheet python3Cheat sheet python3
Cheat sheet python3
 
Diving into byte code optimization in python
Diving into byte code optimization in python Diving into byte code optimization in python
Diving into byte code optimization in python
 
Python Cheat Sheet
Python Cheat SheetPython Cheat Sheet
Python Cheat Sheet
 
Haskell for data science
Haskell for data scienceHaskell for data science
Haskell for data science
 
Python_ 3 CheatSheet
Python_ 3 CheatSheetPython_ 3 CheatSheet
Python_ 3 CheatSheet
 
Exploring slides
Exploring slidesExploring slides
Exploring slides
 
Data Analysis in Python
Data Analysis in PythonData Analysis in Python
Data Analysis in Python
 
Mementopython3 english
Mementopython3 englishMementopython3 english
Mementopython3 english
 

Ähnlich wie Python 培训讲义

Morel, a data-parallel programming language
Morel, a data-parallel programming languageMorel, a data-parallel programming language
Morel, a data-parallel programming languageJulian Hyde
 
Profiling and optimization
Profiling and optimizationProfiling and optimization
Profiling and optimizationg3_nittala
 
sonam Kumari python.ppt
sonam Kumari python.pptsonam Kumari python.ppt
sonam Kumari python.pptssuserd64918
 
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1Little Tukta Lita
 
Introduction to R
Introduction to RIntroduction to R
Introduction to Ragnonchik
 
Pydiomatic
PydiomaticPydiomatic
Pydiomaticrik0
 
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?UFPA
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonakaptur
 
Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0Sheik Uduman Ali
 
R for Pythonistas (PyData NYC 2017)
R for Pythonistas (PyData NYC 2017)R for Pythonistas (PyData NYC 2017)
R for Pythonistas (PyData NYC 2017)Christopher Roach
 
Python Performance 101
Python Performance 101Python Performance 101
Python Performance 101Ankur Gupta
 
TDC2016SP - Trilha Programação Funcional
TDC2016SP - Trilha Programação FuncionalTDC2016SP - Trilha Programação Funcional
TDC2016SP - Trilha Programação Funcionaltdc-globalcode
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Guy Lebanon
 
Morel, a Functional Query Language
Morel, a Functional Query LanguageMorel, a Functional Query Language
Morel, a Functional Query LanguageJulian Hyde
 
Improve Your Edge on Machine Learning - Day 1.pptx
Improve Your Edge on Machine Learning - Day 1.pptxImprove Your Edge on Machine Learning - Day 1.pptx
Improve Your Edge on Machine Learning - Day 1.pptxCatherineVania1
 
Scala as a Declarative Language
Scala as a Declarative LanguageScala as a Declarative Language
Scala as a Declarative Languagevsssuresh
 

Ähnlich wie Python 培训讲义 (20)

Morel, a data-parallel programming language
Morel, a data-parallel programming languageMorel, a data-parallel programming language
Morel, a data-parallel programming language
 
Profiling and optimization
Profiling and optimizationProfiling and optimization
Profiling and optimization
 
sonam Kumari python.ppt
sonam Kumari python.pptsonam Kumari python.ppt
sonam Kumari python.ppt
 
Python basic
Python basicPython basic
Python basic
 
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Pydiomatic
PydiomaticPydiomatic
Pydiomatic
 
Python idiomatico
Python idiomaticoPython idiomatico
Python idiomatico
 
Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?Porque aprender haskell me fez um programador python melhor?
Porque aprender haskell me fez um programador python melhor?
 
Clojure basics
Clojure basicsClojure basics
Clojure basics
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
 
Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0
 
R for Pythonistas (PyData NYC 2017)
R for Pythonistas (PyData NYC 2017)R for Pythonistas (PyData NYC 2017)
R for Pythonistas (PyData NYC 2017)
 
Python Performance 101
Python Performance 101Python Performance 101
Python Performance 101
 
TDC2016SP - Trilha Programação Funcional
TDC2016SP - Trilha Programação FuncionalTDC2016SP - Trilha Programação Funcional
TDC2016SP - Trilha Programação Funcional
 
Haskell 101
Haskell 101Haskell 101
Haskell 101
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)
 
Morel, a Functional Query Language
Morel, a Functional Query LanguageMorel, a Functional Query Language
Morel, a Functional Query Language
 
Improve Your Edge on Machine Learning - Day 1.pptx
Improve Your Edge on Machine Learning - Day 1.pptxImprove Your Edge on Machine Learning - Day 1.pptx
Improve Your Edge on Machine Learning - Day 1.pptx
 
Scala as a Declarative Language
Scala as a Declarative LanguageScala as a Declarative Language
Scala as a Declarative Language
 

Mehr von leejd

与Python一路走来
与Python一路走来与Python一路走来
与Python一路走来leejd
 
17smt.com_从机台程序生成料表
17smt.com_从机台程序生成料表17smt.com_从机台程序生成料表
17smt.com_从机台程序生成料表leejd
 
17smt.com_物料和坐标版本比对
17smt.com_物料和坐标版本比对17smt.com_物料和坐标版本比对
17smt.com_物料和坐标版本比对leejd
 
17smt.com_新程序制作流程
17smt.com_新程序制作流程17smt.com_新程序制作流程
17smt.com_新程序制作流程leejd
 
17smt.com_物料和坐标数据校验
17smt.com_物料和坐标数据校验17smt.com_物料和坐标数据校验
17smt.com_物料和坐标数据校验leejd
 
17smt.com_生产线配置管理
17smt.com_生产线配置管理17smt.com_生产线配置管理
17smt.com_生产线配置管理leejd
 
17smt编程软件(桌面版)
17smt编程软件(桌面版)17smt编程软件(桌面版)
17smt编程软件(桌面版)leejd
 
云制造
云制造云制造
云制造leejd
 

Mehr von leejd (8)

与Python一路走来
与Python一路走来与Python一路走来
与Python一路走来
 
17smt.com_从机台程序生成料表
17smt.com_从机台程序生成料表17smt.com_从机台程序生成料表
17smt.com_从机台程序生成料表
 
17smt.com_物料和坐标版本比对
17smt.com_物料和坐标版本比对17smt.com_物料和坐标版本比对
17smt.com_物料和坐标版本比对
 
17smt.com_新程序制作流程
17smt.com_新程序制作流程17smt.com_新程序制作流程
17smt.com_新程序制作流程
 
17smt.com_物料和坐标数据校验
17smt.com_物料和坐标数据校验17smt.com_物料和坐标数据校验
17smt.com_物料和坐标数据校验
 
17smt.com_生产线配置管理
17smt.com_生产线配置管理17smt.com_生产线配置管理
17smt.com_生产线配置管理
 
17smt编程软件(桌面版)
17smt编程软件(桌面版)17smt编程软件(桌面版)
17smt编程软件(桌面版)
 
云制造
云制造云制造
云制造
 

Kürzlich hochgeladen

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Kürzlich hochgeladen (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Python 培训讲义

  • 2. Python面世 1989年,Guido van Rossum在阿姆斯特丹完成 Guido为了打发圣诞节的无趣,决心开发一个新的脚本解释程序,做为ABC语言的一种继承 第一个Python实现是运行在Mac机 使用Python作为语言的名字,因为是英国幽默剧团:"Monty Python飞行马戏团"的fans ABC是由Guido参加设计的一种教学语言非常优美和强大,是专门为非专业程序员设计的 目前在Google,主要从事GAE/Python3.x方面的研究
  • 4. Python的应用领域 桌面GUI软件开发(wxPython,PyQT…) 网络应用开发(内置模块,Twistd,Stackless…) 2/3D图形处理,游戏开发 (PIL,pyGame…) 文档处理,科学计算(moinmoin,numpy…) Web应用开发(Django,ZOPE,web.py,Quixote…) 移动设备应用开发(PyS60,PySide…) 数据库开发(支持SQL和NOSQL,ZODB…) 嵌入其它应用(嵌入C/C++,delphi,调用DLL…)
  • 5. Python电影情节 工业光魔:http://www.ilm.com 电影特技:《侏罗纪公园》、《变形金刚》、《哈利波特》、《阿凡达》、《星球大战》等 工作站:Linux、IRIX、OS X、Windows、Tru64、Solaris等 Python 1.4(1996年),1.5,2.1 混合使用 主要用来控制和调度各个渲染的机器(maya) 了解更多:http://www.slideshare.net/stingchen/industrial-light-magic-success-story-case-study-iv-python-based-company
  • 6. 适合学习对象 软件开发人员 软件测试人员 软件配置/部署/自动化开发人员 网站运维人员 高级动画设计人员 系统原型架构设计人员
  • 8. 内部实现方式 C -- CPython我们现在使用的/官方发行的 JAVA -- Jythonjava项目中会使用 .NET -- IronPython Python -- pypy Parrot
  • 9. 蟒之禅(Python哲学) 优美胜过丑陋 明确胜过含蓄 简单胜过复杂 复杂胜过难懂 扁平胜过嵌套 稀疏胜过密集
  • 10. 开发环境 IDLE – 安装包自带,交互模式 UliPad – limodou基于wxPython写的,推荐! Eclipse+pydev – 收费的 Eric4 – 基于PyQT4,功能强大 BOA  – 类似于delphi的IDE(wxPython) WingIDE – 共享软件 VIM、Emacs – 主要在linux下使用 Bpython – linux的带提示的交互环境 其它编辑器 UE,notepad++,editplus…
  • 11. 语法特色 动态语言特性 — 可在运行时改变对象本身(属性和方法等) 基于C/C++和JAVA,但有很大区别 缩进方式,建议使用空格,不要用TAB 多个语句在一行使用;分隔 注释符是#,多行使用docstring(’’’…’’’) 变量无需类型定义 可进行函数式编程FP Python3.x的变迁
  • 13. Hello world (1) 表达式 2 + 3 3 + (7 * 4) 3 ** 5 ‘Hello’ + ‘World’ 变量赋值 a = 4 << 3 b = a * 4.5 c = (a+b)/2.5 a = “Hello World” x,y = 4+2,”python” pass 语句– 不做任何事时使用 if a < b: pass else: c = a
  • 14. Hello world (2) if…elif…else语句: 没有switch,有更高级的变通方式(dict字典方式) if a == ‘+’: b = ‘+’ elif a == ‘-’: b = ‘-’ else: b = None 布尔表达式– and, or, not if b >= a and b <= c: print ‘bool is True’ if not (b < a or c > c): print ‘not expr, value is True’
  • 15. None Python特有的空值表示 与C/C++中的NULL是不同的 函数没有明确返回的话,默认返回是None 不能与其它类型进行运算
  • 16. 字符串string str[::], str[0], str[1:2], str[-1:] find/index() #没有找到子串,前者不会扔出异常 replace(),split(),strip() “sub” in “str” #是否存在子串 join()>>>lst = [‘1’, ’2’, ’abc’, ’4’, ’5’]>>>‘,’.join(lst)‘1,2,abc,4,5’
  • 18. 列表list 赋值 a = [2, 3, 4] # A list of integer b = [2, 7, 3.5, “Hello”] # A mixed list c = [] # An empty list d = [2, [a, b]] # 嵌套列表 e = a + b # Join two lists 操作 x = a[1] # Get 2nd element (0 is first) y = b[1:3] # Return a sub-list z = d[1][0][2] # Nested lists b[0] = 42 # Change an element print sum(a) # = 9 x = a.pop(0) # pop第一个数据
  • 19. tuple 赋值 f = (2,3,4,5) # A tuple of integers g = (,) # An empty tuple h = (2, [3,4], (10,11,12))# A tuple containing mixed objects 操作 x = f[1] # Element access. x = 3 y = f[1:3] # Slices. y = (3,4) z = h[1][1] # Nesting. z = 4 特色 与list类似,最大的不同tuple是一种只读且不可变更的数据结构 不可取代tuple中的任意一个元素,因为它是只读不可变更的,也不能进行像list一样的加法操作
  • 20. 字典dict 赋值 a = { } # An empty dictionary b = { ’x’: 3, ’y’: 4 }#有点类似json格式 c = { ’uid’: 105, ’login’: ’beazley’, ’name’ : ’David Beazley’ } 操作 u = c[’uid’] # Get an element c[’shell’] = "/bin/sh" # Set an element dict2 = dict2.update(dict1) #使用dict1中的数据去更新dict2 if c.has_key("directory"): # Check for presence of an member d = c[’directory’] else: d = None d = c.get(“directory”,None) # 带默认值的方式
  • 21. 集合set >>> set( [“hello”, “world”, “of”, “words”, “of”, “world”] )set(['world', 'hello', 'words', 'of']) 如何删除重复数据 Ls1 = [1,3,5,3,7,4,5] Ls2 = list(set(Ls1)) 可以使用&、|求两个set的交集、并集、补集、全集s1 = set([1,2,3])s2 = set([2,4])s1 & s2 #{2} s1 | s2 #{1,2,3,4} s1 - s2 #{1,3}s1 ^ s2 #{1,3,4}
  • 22. 循环 While语句 while a < b: a = a + 1 break For语句(遍历序列的元素) for item in [3, 4, 10, 25]: print item # Print characters one at a time for c in "Hello World": print c # Loop over a range of numbers for i in xrange(0,100,2): print i for i in xrange(len(list1)): print list1[i]
  • 23. 死循环怎么办? 桌面应用可以马上知道,并杀死对应进程 服务器应用怎么去监控? 计数器:在循环的最里面计数,超过指定数值就退出,缺点太多了 让函数带有超时功能
  • 24. 函数 def语句 def func1(a,b):#没有指针,函数内的数据只能通过返回 q = a/b r = a - q*b return r # 调用方式 a = func1(42,5) # a = 2 返回多个值 def func2(a,b): q = a/b r = a - q*b return q,r x,y = func2(42,5) # x = 8, y = 2
  • 25. 类class class语句 class Account: def __init__(self, initial): self.balance = initial def deposit(self, amt): self.balance = self.balance + amt def withdraw(self,amt): self.balance = self.balance – amt def getBalance(self): return self.balance 使用定义好的class a = Account(1000.0) a.deposit(550.23) a.deposit(100) a.withdraw(50) print a.getBalance()
  • 26. 异常处理 try语句 try: f = open(“foo“,”r”) except IOError: print "Couldn’t open ’foo’. Sorry.“ raise语句 def factorial(n): if n < 0: raise ValueError,"Expected non-negative number" if (n <= 1): return 1 else: return n*factorial(n-1) 沒有处理的异常 >>> factorial(-1) Traceback (innermost last): File "<stdin>", line 1, in ? File "<stdin>", line 3, in factorial ValueError: Expected non-negative number
  • 27. 文件操作 open()函数 f = open("foo","w") # Open a file for writing g = open("bar","r") # Open a file for reading 文件的读取/写入 f.write("Hello World") buff = g.read() # Read all data line = g.readline() # Read a single line lines = g.readlines() # Read data as a list of lines with do # py2.6以后版本提供 格式化的输入输出 使用%来格式化字符串 for i in range(0,10): f.write("2 times %d = %d" % (i, 2*i))
  • 28. 目录操作 把path1目录下面的*.html更名为*.htm for root,dirs,files in os.walk(path1): for item in files: if item[-5:].upper() != '.HTML‘: continue filename = os.sep.join([root,item]) print filename file1 = filename[:-5]+'.htm' os.rename(filename, file1)
  • 29. 匿名函数 lambda 从 Lisp 语言借用来的,只是一种风格,可用函数替换 >>> def func(x): ... return x*2 >>> func(3) 6 >>> g = lambda x: x*2 >>> g(3) 6 >>> (lambda x: x*2)(3) 6 请对下列数组进行排序 (先x再y,类似于SQL中的order by x,y) list1 = [{'x':1,'y':100},{'x':30,'y':50},{'x':0,'y':0},{'x':60,'y':90},{'x':30,'y':28}] sorted(list1, lambda a,b:cmp((a['x'],a['y']),(b['x'],b['y'])))
  • 30. 字符编码 Python2.x默认的是OS的本地编码 Python3.x是unicode内部编码 .py文件第一行:#coding=utf-8,不指定编码时,文件中包含非ASCII字符会报错 s1 = "中文1" s2 = u"中文2" print unicode(s1,'utf-8').encode('gbk') print s2.encode('gbk') print type(unicode(s1,'utf-8')),type(s2),type(s2.encode('gbk'))
  • 31. 指针?引用? Python里面没有指针 所有都是对象 对象之间都是引用(引用计数方式) 常用的对象都有cache 默认是浅拷贝,深拷贝代码:str[::] import copy  ls1 = [1,”test”,(3.4,7),{“key”:1, “comment”:”your comment”}] ls2 = copy.deepcopy(ls1)
  • 32. 正则表达式 导入模块: import rep = re.compile('ab*', re.IGNORECASE)p = re.compile('[a-z]+') match()函数只检测是不是在string的开始位置,只有在0位置匹配成功的话才有返回,如果不是开始位置匹配成功的话,match()就返回None。 search()会扫描整个string查找匹配
  • 33. 单元测试 unittest模块中的TestCase 类代表测试用例 TestCase类的实例是可以完全运行测试方法 可选的设置 (set-up)以及清除(tidy-up)代码的对象 TestCase实例的测试代码,可以单独运行或与其它任意数量的测试用例共同运行 简单测试用例 import unittest class DefaultWidgetSizeTestCase(unittest.TestCase): def runTest(self): widget = Widget("The widget") assert widget.size() == (50,50), 'incorrect size'
  • 34. 性能优化 Python的开发效率很高 Python的执行效率很低,比C++和JAVA都慢 循环/函数调用等很消耗资源 数据结构的性能很高,目前可以认为是优化到极致 优化方式: 用timeit分析之后优化对应代码 使用psyco做JIT加速 Hash算法来替代某些常规语句 使用C模块来替换业务热点 部分地方可以使用map来替代for …in…循环 字符串少用+操作,特别是连续+ 不要迷恋语言性能,业务性能才是关键!
  • 35.
  • 37. 输出大任务的最终结果。Python中的代码,是不是有点云计算的味道? >>> seq = range(8) >>> zip(seq, map(lambda x:x*x, seq)) [(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), (5, 25), (6, 36), (7, 49)] >>> reduce(lambda x,y:x+y, xrange(1, 11)) 55
  • 38. 调用系统命令 os.system(), os.spawn*, os.popen*, popen2.* A、新起一个shell去干活的,对系统的开销比较大 B、获得输出等信息比较麻烦,不能与外部命令或工具交互 C、主进程无法控制,调用进程会block commands  易获得外部命令的输出 B、C subprocess  Python2.6以后版本提供 解决上述模块不足
  • 39. getattr/setattr Python的类继承 动态方式调用基类函数 使用dir(f)可以看到属性: im_class,im_func, im_self
  • 40.
  • 43.
  • 44. 动态调用 – 执行 Owner为厂家名称 device为厂家旗下的设备。 如果找不到设备的.py文件,则去调用厂家的.py #调用指定目录下的pana/bm123.py mod = loadModule(“pana”, “bm123”) if not mod:return obj = mod.Smt() obj.xxxx()
  • 46. *  Python 不要以C/C++的思维去开发Python 不要以JAVA的思维去开发Python 不要以C#的思维去开发Python 不要以PHP的思维去开发Python Python开发需要的是Pythonic(蟒之禅)
  • 47. 8荣8耻 以动手实践为荣 , 以只看不练为耻;  以打印日志为荣 , 以单步跟踪为耻;  以空格缩进为荣 , 以制表缩进为耻;  以单元测试为荣 , 以人工测试为耻;  以模块复用为荣 , 以复制粘贴为耻;  以多态应用为荣 , 以分支判断为耻;  以Pythonic为荣 , 以冗余拖沓为耻;  以总结分享为荣 , 以跪求其解为耻;  
  • 48. 书籍推荐 帮助手册,安装时附带的 《Dive Into Python》/中文版 《可爱的Python》 《Python源码剖析》-- 高级
  • 49. 谢谢! 国内Python组:python-cn@googlegroups.com 啄木鸟社区:http://wiki.woodpecker.org.cn/ Python官网:http://www.python.org/ Django官网: http://www.djangoproject.com/ UliPad: http://code.google.com/p/ulipad/ wxPython:http://www.wxpython.org/ PyQT:http://www.riverbankcomputing.co.uk/