1 / 90

Python A Comprehensive Programming Language

Python A Comprehensive Programming Language. 胡崇偉 marr@citi.sinica.edu.tw Open Source Software Foundry. 自由軟體鑄造場. 營運網站以提供自由軟體專案進駐開發 提供系統技術與工具以協助軟體開發 研究開放源碼軟體授權條款與法律政策議題並提供諮詢 媒合促成以自由軟體為基礎的本地成功案例 報導國內外產業及社群新聞 進行人才培育及國際交流活動. Service and Resource. 專案管理. Service and Resource. 共同筆記. 版本管理.

johnvaughn
Download Presentation

Python A Comprehensive Programming Language

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PythonA ComprehensiveProgramming Language 胡崇偉 marr@citi.sinica.edu.tw Open Source Software Foundry

  2. 自由軟體鑄造場 • 營運網站以提供自由軟體專案進駐開發 • 提供系統技術與工具以協助軟體開發 • 研究開放源碼軟體授權條款與法律政策議題並提供諮詢 • 媒合促成以自由軟體為基礎的本地成功案例 • 報導國內外產業及社群新聞 • 進行人才培育及國際交流活動

  3. Service and Resource 專案管理

  4. Service and Resource 共同筆記 版本管理 檔案下載 專案管理 通信論壇 待辦事項 統計資訊

  5. Service and Resource 資源目錄 共同筆記 人才資料 版本管理 檔案下載 授權條款 精靈 專案管理 電子報 通信論壇 待辦事項 研究報告 教學文件 統計資訊 推廣光碟

  6. Python?

  7. Pythonis a Dynamic Object-Oriented Programming Language

  8. Run-Time Typing • Python's run time must work harder than Java's. • a + b = ? • inspect the objects a and b to find out their type, which is not known at compile time. • 7 + 11.0 • ‘Hello’ + ‘world’ • (1, 2, 3) + (4, 5, 6)

  9. Interactive with Interpreter Edit Read-Eval-Print Loop Debug Compile Wait Deploy Read Print Eval

  10. >>>是提示符號

  11. Built-in DataTypes • Number • String • List • Tuple • Dictionary 7, 11.0 ‘Hello World’ [7, 11, ‘store’] (7, 11, ‘shop’) {‘name’:’marr’, ‘home’:’taipei’} elements elements

  12. MIT to Try Python in CS Courses

  13. Other Features • Cross Platform and Porting • Excellent Modules • Small • Efficient • Popular

  14. Nokia PyS60

  15. Indexing and Slicing • myString = “I Love Python” • myString[0] == “I” • myString[-1] == “n” • myString[7:-2] == “Pyth”

  16. Code Indenting • No explicit begin or end • No curly braces if age > 18: print “You are old enough.” else: print “You are too young.”

  17. Function Example def myFunc(score): “”” document strings “”” import math math.sqrt(score) * 10

  18. File Handling fileobj = open(“myfile”, “r”) lines = fileobj.readlines() for line in lines: print line

  19. Socket Creation import socket s = socket.socket( socket.AF_INET, socket.SOCK_STREAM) s.connect( ("www.mysite.com", 80))

  20. Python Package Index

  21. RestructuredText • http://docutils.sourceforge.net/ • Support Formats: HTML,XML,S5,LaTeX • rst2html < myRST.txt > myRST.html

  22. Version Control • Mercurial

  23. GUI Library and Toolkit

  24. Wingware IDE

  25. PyGame

  26. PyGame

  27. Blender

  28. Elephants Dream

  29. SQLAlchemy

  30. Web Frameworks

  31. Python Hosting

  32. Plone … a CMS Built on Zope Written in Python

  33. Blog (CoreBlog)

  34. Portal (CIA, USA)

  35. Portal (NASA, USA)

  36. Network Management (ZenOSS)

  37. Issue Tracker (Poi)

  38. Download Installer • http://plone.org/products/plone

  39. Windows Installer

  40. Windows Installer

  41. Windows Installer

  42. Plone Controller

  43. Filesystem Listing • Python • Zope • Plone • Packages/Products • Software Home • Instance Home

  44. One Database, Many Instances HTTP Requests and Responses port 8081 port 8080 ZEO Client #1 ZEO Client #2 Instance #1 Instance #2 Data.fs

  45. Front Page

  46. Zope Management Interface (ZMI)

  47. Site Setup

  48. Guest View

  49. Authenticated View

  50. Tip for Trying Out -Different BrowsersforDifferent Users/Roles One for Admin, Another for Regular User

More Related