a brief introduction to python

13
人生苦短,我用 Python Blackball @ . bugway gmail com

Upload: bugway

Post on 29-Jun-2015

983 views

Category:

Documents


6 download

DESCRIPTION

Introduce Py

TRANSCRIPT

Page 1: A brief introduction to Python

人生苦短,我用 Python

Blackball@ .bugway gmail com

Page 2: A brief introduction to Python

内容目录

-Python 简介- Python 基本语法-日常问题-Python 解决方案-Python 高级主题-讨论-参考资料

Page 3: A brief introduction to Python

Python 简介

-1991,Guido van Rossum(Google) “Top 20 Programming languages in November” -“多口味”脚本语言

Object Oriented,Functional programming,etc.

-跨平台Windows,Linux, Macintosh, Symbian, etc.

-丰富的第三方库PIL,Numpy,Matplotlib,wxPython,OpenCV,lxml,etc.

-“可运行的伪代码”

Page 4: A brief introduction to Python

Python 基本语法

-类型 bool,int,float,long,complex,string,  bytes,list,tuple,set,dictionary

-运算符+,-,*,/,//,%,**~,&,|,^,<<,>>and,not,or,is,in

- console 窗口示例

-控制流if-elif-else,for-in,while,(try-raise)

-函数,类def foo([p0,p1,..]): class Person:

pass pass

[lambda]

-参看 basicGramma.py

Page 5: A brief introduction to Python

一个典型 Python 脚本# -*- coding: utf-8 -*-

# this is a commentprint “Hello world!”

def areYouWet( hot ):if hot == True:

print “Wet”return True

else:print “Dry”return False

if __name__ == “__main__”: # unitestHot = Trueprint areYouWet(Hot)

>>>Wet>>>True

Page 6: A brief introduction to Python

日常问题

-文件操作*文件名操作*文件内容操作

-图像批量处理*缩放*裁剪/抠图*旋转*格式转换

-快速原型开发*基于...呃 ...懒惰*基于OpenCV

-批量数据操作*矩阵运算*数据分析*样本聚类*数据拟合

-绘图*可视化分析

Page 7: A brief introduction to Python

Python 解决方案-文件操作

*文件名操作 - rename.py*文件内容操作

-图像批量处理*缩放 - resize.py*裁剪/抠图 -crop.py*旋转 -roate.py*格式转换 -convert.py

-批量数据操作*矩阵运算 - matrix.py*数据分析 - callPCA.py*样本聚类 - meanshift.py *数据拟合 - curveFitting.py

Page 8: A brief introduction to Python

Python 解决方案

-快速原型开发*基于伪代码 - insertSort.py *基于 OpenCV - faceDetect.py

-画图[matplotlib ]*数据可视化分析 - ploting.py,ploting2.py

Page 9: A brief introduction to Python

高级主题

-类修饰方法(@Decoration)

-元类,抽象基类

-异常处理

-C/ C++通信

Page 10: A brief introduction to Python

讨 论

Page 11: A brief introduction to Python

参考资料

-python language documentation- python 核心编程- google:Numpy, matplotlib,PIL,...etc- Python 科学计算-相关电子书事后会悉数上传到服务器上去

Page 12: A brief introduction to Python

谢 谢

Page 13: A brief introduction to Python

几事

-服务器已经架设好 但是还没有完全配置好

Ftp://192.168.1.63

-下次两周后,同样时间彪哥 和我

-关于交流会完善靠大家