python a comprehensive programming language

90
Python A Comprehensive Programming Language 胡胡胡 [email protected] Open Source Software Foundry

Upload: hidi

Post on 08-Jan-2016

64 views

Category:

Documents


4 download

DESCRIPTION

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

TRANSCRIPT

Page 1: Python A Comprehensive Programming Language

Python

A ComprehensiveProgramming Language

胡崇偉[email protected]

Open Source Software Foundry

Page 2: Python A Comprehensive Programming Language

自由軟體鑄造場

• 營運網站以提供自由軟體專案進駐開發• 提供系統技術與工具以協助軟體開發• 研究開放源碼軟體授權條款與法律政策議題並提供諮詢

• 媒合促成以自由軟體為基礎的本地成功案例

• 報導國內外產業及社群新聞• 進行人才培育及國際交流活動

Page 3: Python A Comprehensive Programming Language

Service and Resource

專案管理

Page 4: Python A Comprehensive Programming Language

Service and Resource

專案管理

版本管理

共同筆記

檔案下載

通信論壇

統計資訊

待辦事項

Page 5: Python A Comprehensive Programming Language

Service and Resource

專案管理

版本管理

共同筆記

檔案下載

通信論壇

統計資訊

待辦事項

資源目錄 人才資料

授權條款精靈

研究報告教學文件

電子報

推廣光碟

Page 6: Python A Comprehensive Programming Language

Python ?

Page 7: Python A Comprehensive Programming Language

Python is a

DynamicObject-Oriented

Programming Language

Page 8: Python A Comprehensive Programming Language

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)

Page 9: Python A Comprehensive Programming Language

Interactive with Interpreter

Read-Eval-Print Loop

Edit

Compile

Deploy

DebugWait

Read

Eval

Print

Page 10: Python A Comprehensive Programming Language

>>> 是提示符號

Page 11: Python A Comprehensive Programming Language

Built-in DataTypes

• Number

• String

• List

• Tuple

• Dictionary

7, 11.0

‘Hello World’

[7, 11, ‘store’]

(7, 11, ‘shop’)

{‘name’:’marr’, ‘home’:’taipei’}

elementselements

Page 12: Python A Comprehensive Programming Language

MIT to Try Python in CS Courses

Page 13: Python A Comprehensive Programming Language

Other Features

• Cross Platform and Porting• Excellent Modules• Small• Efficient• Popular

Page 14: Python A Comprehensive Programming Language

Nokia PyS60

Page 15: Python A Comprehensive Programming Language

Indexing and Slicing

• myString = “I Love Python”

• myString[0] == “I”

• myString[-1] == “n”

• myString[7:-2] == “Pyth”

I L o v e P y t h o n

[0

1

2

7

-6

-2

-1

↓]

Page 16: Python A Comprehensive Programming Language

Code Indenting

• No explicit begin or end

• No curly braces

if age > 18: print “You are old enough.”else: print “You are too young.”

Page 17: Python A Comprehensive Programming Language

Function Example

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

Page 18: Python A Comprehensive Programming Language

File Handling

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

Page 19: Python A Comprehensive Programming Language

Socket Creation

import socket

s = socket.socket( socket.AF_INET, socket.SOCK_STREAM)s.connect( ("www.mysite.com", 80))

Page 20: Python A Comprehensive Programming Language

Python Package Index

Page 21: Python A Comprehensive Programming Language

RestructuredText

• http://docutils.sourceforge.net/

• Support Formats: HTML,XML,S5,LaTeX

• rst2html < myRST.txt > myRST.html

Page 22: Python A Comprehensive Programming Language

Version Control

• Mercurial

Page 23: Python A Comprehensive Programming Language

GUI Library and Toolkit

Page 24: Python A Comprehensive Programming Language

Wingware IDE

Page 25: Python A Comprehensive Programming Language

PyGame

Page 26: Python A Comprehensive Programming Language

PyGame

Page 27: Python A Comprehensive Programming Language

Blender

Page 28: Python A Comprehensive Programming Language

Elephants Dream

Page 29: Python A Comprehensive Programming Language

SQLAlchemy

Page 30: Python A Comprehensive Programming Language

Web Frameworks

Page 31: Python A Comprehensive Programming Language

Python Hosting

Page 32: Python A Comprehensive Programming Language

Plone …

a CMS

Built on Zope

Written in Python

Page 33: Python A Comprehensive Programming Language

Blog (CoreBlog)

Page 34: Python A Comprehensive Programming Language

Portal (CIA, USA)

Page 35: Python A Comprehensive Programming Language

Portal (NASA, USA)

Page 36: Python A Comprehensive Programming Language

Network Management (ZenOSS)

Page 37: Python A Comprehensive Programming Language

Issue Tracker (Poi)

Page 38: Python A Comprehensive Programming Language

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

Page 39: Python A Comprehensive Programming Language

Windows Installer

Page 40: Python A Comprehensive Programming Language

Windows Installer

Page 41: Python A Comprehensive Programming Language

Windows Installer

Page 42: Python A Comprehensive Programming Language

Plone Controller

Page 43: Python A Comprehensive Programming Language

Filesystem Listing

• Python

• Zope

• Plone

• Packages/Products

• Software Home

• Instance Home

Page 44: Python A Comprehensive Programming Language

One Database, Many Instances

HTTP Requests and Responses

Instance #1 Instance #2

ZEO Client #1 ZEO Client #2port 8080 port 8081

Data.fs

Page 45: Python A Comprehensive Programming Language

Front Page

Page 46: Python A Comprehensive Programming Language

Zope Management Interface (ZMI)

Page 47: Python A Comprehensive Programming Language

Site Setup

Page 48: Python A Comprehensive Programming Language

Guest View

Page 49: Python A Comprehensive Programming Language

Authenticated View

Page 50: Python A Comprehensive Programming Language

Tip for Trying Out -Different Browsers

forDifferent Users/Roles

One for Admin, Another for Regular User

Page 51: Python A Comprehensive Programming Language

Usecase #1

Create

a New User

Page 52: Python A Comprehensive Programming Language
Page 53: Python A Comprehensive Programming Language

Views Available After Login

• Personal Bar

• Content Views

Page 54: Python A Comprehensive Programming Language

Usecase #2

CreateNew Contents

(Page)

Page 55: Python A Comprehensive Programming Language

Default Content Types

Page

News Item

Event

Image

File

Link

Page 56: Python A Comprehensive Programming Language

Title to ID (Part of the URL)

Page 57: Python A Comprehensive Programming Language

Visual Editor

Page 58: Python A Comprehensive Programming Language

Content States

Page 59: Python A Comprehensive Programming Language

Default State and Workflow

Page 60: Python A Comprehensive Programming Language

Roles and Permissions

View Add Edit Review

Manager ✔ ✔ ✔ ✔

Reviewer ✔ ✔ ✔

Member ✔ ✔ ✔

Non-Login ?

Page 61: Python A Comprehensive Programming Language

Core Security Mapping

Page 62: Python A Comprehensive Programming Language

Transaction and Undo

Page 63: Python A Comprehensive Programming Language

Usecase #3

Manage

Portlets

Page 64: Python A Comprehensive Programming Language
Page 65: Python A Comprehensive Programming Language
Page 66: Python A Comprehensive Programming Language
Page 67: Python A Comprehensive Programming Language
Page 68: Python A Comprehensive Programming Language

Usecase #4

Enable

OpenID Support

Page 69: Python A Comprehensive Programming Language
Page 70: Python A Comprehensive Programming Language

Usecase #5

Change Theme (to NuPlone)

Page 71: Python A Comprehensive Programming Language

Free Themes

Page 72: Python A Comprehensive Programming Language

Better and Super Plone ?

Page 73: Python A Comprehensive Programming Language

Want More ?

Join the Community and Develop !

Page 74: Python A Comprehensive Programming Language

Starting Points• http://plone.org/documentation• http://marrtw.blogspot.com/2009/04/plone3-books.html

Page 75: Python A Comprehensive Programming Language

SQL Database Connection

MySQLDatabase

Connection

PgSQLDatabase

Connection

ODBCDatabase

Connection

Z SQLMethod

Z SQLMethod

Z SQLMethod

Z SQLMethod

Z SQLMethod

Z SQLMethod

Page 76: Python A Comprehensive Programming Language

Database Components

GadflyMySQL

MySQLDA

PostgreSQL

PsycopgDA

MSSQL

ODBCDA

Zope

Z SQL Method

Search Interface

DTML

Script

Page Template

HTML WYSWYG Editor

DatabaseAdapter

PloneSite

Developmentand

Management

DatabaseConnection

Page 77: Python A Comprehensive Programming Language

Designer Friendly Templates

• Work with WYSIWYG editors

• Zope Page Template (ZPT)– Template Attribute Language (TAL)– Macro Expansion Tag Attribute Language (METAL)

<title tal:content="here/title">Page Title</title>

AttributeName

XML Namespace

AttributeValue

name bodyTAL statement

ElementContent

Page 78: Python A Comprehensive Programming Language

Theme Designers ?

• AJAX / jQuery Support

• KSS = Kinetic Style Sheets

• Deliverance

• Must Read– Plone 3 Theming

Page 79: Python A Comprehensive Programming Language

Repeatable Development

buildout.cfg bin/buildout

editing running with

PythonPackageIndex

checking into

*.egg

*.tar.gz

downloadingproduct/package

installed as

Page 80: Python A Comprehensive Programming Language

Build Your Own Project

cd c:\C:\plone\python\Scripts\paster create plone3_buildout MyBuildout

cd MyBuildoutvim buildout.cfgbin\buildout.exe

Page 81: Python A Comprehensive Programming Language

buildout.cfg Sample

[buildout]http-address = 8080eggs = Plone my.packagezcml = my.packagedebug-mode = on

Page 82: Python A Comprehensive Programming Language

Summary

A Comprehensive CMS ?通用型的內容管理系統

The Web CMS Report

Ideaware Report

Page 83: Python A Comprehensive Programming Language

Web CMS 2007Content Production ServicesAuthoring & TransformationAggregationRepository ServicesMetadata/Taxonomy ManagementGlobalizationPromotion PathSystem Reporting

Content Delivery ServicesPersonalizationSite SearchScaling & PerformanceMultichannel & SyndicationContent RetentionUser-Generated ContentMicro-ApplicationsSite Analytics

Vendor IntangiblesMaintenance & SupportIntegration & Tech PartnershipsActive User GroupsServices & ChannelProduct QAStrategy & RoadmapGood Value

TechnologyStandardsDevelopmentAccess ControlTemplatingPage RenderingUsabilityInternationalization

Page 84: Python A Comprehensive Programming Language

Active Community

Page 85: Python A Comprehensive Programming Language

Multilingual Support

Page 86: Python A Comprehensive Programming Language

Open Source Projects

OpenPlans

ArgoUML

SchoolTool

Page 87: Python A Comprehensive Programming Language

Alternative Theming - Deliverance

Page 88: Python A Comprehensive Programming Language

Developer Baby Steps• Python Script + External Method

Page 89: Python A Comprehensive Programming Language

Plone Hosting

Page 90: Python A Comprehensive Programming Language

Thank You !

Question?

Email to [email protected]