SlideShare ist ein Scribd-Unternehmen logo
1 von 59
Dynamic Python Think Dynamic [email_address]
Python Advertising ,[object Object],[object Object]
Master says…. ,[object Object],[object Object],[object Object],[object Object]
Master says….      (cont.) ,[object Object],[object Object],[object Object]
Master says…. (cont.) ,[object Object]
Master says…. (cont.) ,[object Object]
http://shootout.alioth.debian.org/gp4/benchmark.php?test= all&lang =perl&lang2=python
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=php&lang2=python
http://shootout.alioth.debian.org/gp4/benchmark.php?test= all&lang =java&lang2=python
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=ruby&lang2=python
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=gpp&lang2=python
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=gpp&lang2=java
Today’s topic ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
One Minute Python Tutorial ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Choice – If …..and only if …. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
Five Minutes Python Deploy Demo ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Topic 1 String, Slice
Python String ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Manipulate strings (type str) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Slices 0  1  2  3  4  5 -5  -4  -3  -2  -1 This is so called “Slice “ syntax [A:B] o l l e H
Manipulate strings (cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Manipulate string  (cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Topic 2 List, Sequence, Iterator
List ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Slices advanced. (python 2.3↑) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sequence ,[object Object],[object Object]
iterator  ,[object Object],[object Object],[object Object],[object Object]
How Java iterate Sequence (Collection, Array) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
iterable  ,[object Object],[object Object],[object Object],[object Object]
Iterable demo ,[object Object],[object Object],[object Object],[object Object],[object Object]
Sequence (summary) ,[object Object],[object Object]
Topic 3 Namespace, Polymorph
A simple question… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Namespace ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Namespace (cont.) ,[object Object],[object Object],[object Object],[object Object]
Python Mind Testing Problem ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Python Mind Testing Problem(cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
name-based polymorphism .  ,[object Object],[object Object],[object Object],[object Object],[object Object]
show() Base x=A()  #you can also try this class Base; x.show()  array = [ A(),B(),C() ]  class A extends Base; x=B()  for x in array:    class B extends Base; x.show() x.show() class C extends Base; x=C() Base x; x.show()  x= new B(); x.show(); or  interface Base, whatever. show() A show() B show() C
Topic 4 Duck Typing
duck-typing   ,[object Object],[object Object],[object Object],[object Object]
duck-typing (cont.) ,[object Object],[object Object],[object Object],Not pythonic
OK, What’s WRONG about  “Just Check type” ? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Quick list and dict syntax ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Duck typing (cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Do you see convenient? ,[object Object],[object Object],[object Object],[object Object]
Python is TOO DYNAMIC,  Can I have a real constants? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Topic 5 Some Pattern
And… Singleton Pattern?  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
__new__ ,[object Object],[object Object],[object Object],[object Object],[object Object]
Classic Singleton Pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Python’s Borg Pattern ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
For those Getter and setters… okokok, python DO have it… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Factory pattern? ,[object Object],[object Object],[object Object]
inherit  in python ,[object Object],[object Object],[object Object],[object Object]
class factory  function ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Topic 6 Python is MUCH POWERFUL   than what I introduced,  TRY IT yourself.
Thank You! Present by Python fans: [email_address] To be continued….

Weitere ähnliche Inhalte

Was ist angesagt?

Gae icc fall2011
Gae icc fall2011Gae icc fall2011
Gae icc fall2011
Juan Gomez
 

Was ist angesagt? (20)

Beyond the Style Guides
Beyond the Style GuidesBeyond the Style Guides
Beyond the Style Guides
 
Keep your repo clean
Keep your repo cleanKeep your repo clean
Keep your repo clean
 
Programming with Python - Adv.
Programming with Python - Adv.Programming with Python - Adv.
Programming with Python - Adv.
 
python.ppt
python.pptpython.ppt
python.ppt
 
Python Interview Questions And Answers 2019 | Edureka
Python Interview Questions And Answers 2019 | EdurekaPython Interview Questions And Answers 2019 | Edureka
Python Interview Questions And Answers 2019 | Edureka
 
Introduction to Python for Bioinformatics
Introduction to Python for BioinformaticsIntroduction to Python for Bioinformatics
Introduction to Python for Bioinformatics
 
Introduction to Python Pandas for Data Analytics
Introduction to Python Pandas for Data AnalyticsIntroduction to Python Pandas for Data Analytics
Introduction to Python Pandas for Data Analytics
 
The Benefits of Type Hints
The Benefits of Type HintsThe Benefits of Type Hints
The Benefits of Type Hints
 
Python
PythonPython
Python
 
Let’s Learn Python An introduction to Python
Let’s Learn Python An introduction to Python Let’s Learn Python An introduction to Python
Let’s Learn Python An introduction to Python
 
Python in 90 minutes
Python in 90 minutesPython in 90 minutes
Python in 90 minutes
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
 
Python for Linux System Administration
Python for Linux System AdministrationPython for Linux System Administration
Python for Linux System Administration
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Effective testing with pytest
Effective testing with pytestEffective testing with pytest
Effective testing with pytest
 
обзор Python
обзор Pythonобзор Python
обзор Python
 
Gae icc fall2011
Gae icc fall2011Gae icc fall2011
Gae icc fall2011
 
Pytest - testing tips and useful plugins
Pytest - testing tips and useful pluginsPytest - testing tips and useful plugins
Pytest - testing tips and useful plugins
 
Programming Under Linux In Python
Programming Under Linux In PythonProgramming Under Linux In Python
Programming Under Linux In Python
 
Implementing a decorator for thread synchronisation.
Implementing a decorator for thread synchronisation.Implementing a decorator for thread synchronisation.
Implementing a decorator for thread synchronisation.
 

Andere mochten auch (7)

董大偉,Silverlight實務應用範例講座
董大偉,Silverlight實務應用範例講座董大偉,Silverlight實務應用範例講座
董大偉,Silverlight實務應用範例講座
 
下班就跑是富有哲學道理1
下班就跑是富有哲學道理1下班就跑是富有哲學道理1
下班就跑是富有哲學道理1
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
 
世界是平的
世界是平的世界是平的
世界是平的
 
Natural language procesing in R
Natural language procesing in RNatural language procesing in R
Natural language procesing in R
 
Topic Modeling for Learning Analytics Researchers LAK15 Tutorial
Topic Modeling for Learning Analytics Researchers LAK15 TutorialTopic Modeling for Learning Analytics Researchers LAK15 Tutorial
Topic Modeling for Learning Analytics Researchers LAK15 Tutorial
 
Natural language processing using comcast reviews
Natural language processing using comcast reviewsNatural language processing using comcast reviews
Natural language processing using comcast reviews
 

Ähnlich wie Dynamic Python

Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...
Simplilearn
 

Ähnlich wie Dynamic Python (20)

Python: an introduction for PHP webdevelopers
Python: an introduction for PHP webdevelopersPython: an introduction for PHP webdevelopers
Python: an introduction for PHP webdevelopers
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
 
Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...
 
About Python
About PythonAbout Python
About Python
 
Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard Way
 
From Java to Python: beating the Stockholm syndrome
From Java to Python: beating the Stockholm syndromeFrom Java to Python: beating the Stockholm syndrome
From Java to Python: beating the Stockholm syndrome
 
Python cheat-sheet
Python cheat-sheetPython cheat-sheet
Python cheat-sheet
 
Introduction to Python
Introduction to Python Introduction to Python
Introduction to Python
 
Ajax and JavaScript Bootcamp
Ajax and JavaScript BootcampAjax and JavaScript Bootcamp
Ajax and JavaScript Bootcamp
 
Functions, List and String methods
Functions, List and String methodsFunctions, List and String methods
Functions, List and String methods
 
Python for Dummies
Python for DummiesPython for Dummies
Python for Dummies
 
PRESENTATION ON PYTHON.pptx
PRESENTATION ON PYTHON.pptxPRESENTATION ON PYTHON.pptx
PRESENTATION ON PYTHON.pptx
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
Python for dummies
Python for dummiesPython for dummies
Python for dummies
 
Programming with Python
Programming with PythonProgramming with Python
Programming with Python
 
These questions will be a bit advanced level 2
These questions will be a bit advanced level 2These questions will be a bit advanced level 2
These questions will be a bit advanced level 2
 
Introduction to Python for Plone developers
Introduction to Python for Plone developersIntroduction to Python for Plone developers
Introduction to Python for Plone developers
 
Programming with Python - Week 3
Programming with Python - Week 3Programming with Python - Week 3
Programming with Python - Week 3
 
Python to scala
Python to scalaPython to scala
Python to scala
 

Mehr von Chui-Wen Chiu

Mehr von Chui-Wen Chiu (20)

移動內存算法
移動內存算法移動內存算法
移動內存算法
 
墾丁 更新版
墾丁  更新版墾丁  更新版
墾丁 更新版
 
墾丁 更新版2
墾丁  更新版2墾丁  更新版2
墾丁 更新版2
 
Bw1096
Bw1096Bw1096
Bw1096
 
高雄新地標 統一夢世代
高雄新地標  統一夢世代高雄新地標  統一夢世代
高雄新地標 統一夢世代
 
Borland傳奇
Borland傳奇Borland傳奇
Borland傳奇
 
Python 庫簡介
Python 庫簡介Python 庫簡介
Python 庫簡介
 
Asp.Net Mvc 1.0
Asp.Net Mvc 1.0Asp.Net Mvc 1.0
Asp.Net Mvc 1.0
 
天下第一 夜市總冠軍
天下第一 夜市總冠軍天下第一 夜市總冠軍
天下第一 夜市總冠軍
 
認識腸病毒
認識腸病毒認識腸病毒
認識腸病毒
 
排隊的店
排隊的店排隊的店
排隊的店
 
柬埔寨鄉村婚禮
柬埔寨鄉村婚禮柬埔寨鄉村婚禮
柬埔寨鄉村婚禮
 
新 創 意
新 創 意新 創 意
新 創 意
 
挖好屬於自己的井
挖好屬於自己的井挖好屬於自己的井
挖好屬於自己的井
 
Why The Us Wants War 080702
Why The Us Wants War  080702Why The Us Wants War  080702
Why The Us Wants War 080702
 
你今天的選擇是什麼?
你今天的選擇是什麼?你今天的選擇是什麼?
你今天的選擇是什麼?
 
我的學思歷程 劉兆玄
我的學思歷程 劉兆玄我的學思歷程 劉兆玄
我的學思歷程 劉兆玄
 
Unknown Parameter Value
Unknown Parameter ValueUnknown Parameter Value
Unknown Parameter Value
 
你也在井裡嗎
你也在井裡嗎你也在井裡嗎
你也在井裡嗎
 
感觸
感觸感觸
感觸
 

Dynamic Python

Hinweis der Redaktion

  1. 無招勝有招 多型不如無型 重劍無鋒大巧不工
  2. Python don’t need a base “class” to do this… if it walks like a duck and quacks like a duck, it's duck-like enough for our purposes …