Python - A Comprehensive Programming Language, talk at
1. CSIE, Providence University, 2009/05/08
2. CSIE, National Taichung Institute of Technology, 2009/10/29
8. Python is a
Dynamic
Object-Oriented
Programming Language
9. 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)
16. Indexing and Slicing
0 1 2 7
[ ↓ ↓ ↓
-6
↓
-2 -1
↓ ↓
]
I L o v e P y t h o n
• myString = “I Love Python”
• myString[0] == “I”
• myString[-1] == “n”
• myString[7:-2] == “Pyth”
17. Code Indenting
• No explicit begin or end
• No curly braces
if age > 18:
print “You are old enough.”
else:
print “You are too young.”
21. Twisted - Networking Engine
• A web server, numerous chat
clients, chat servers, mail servers
and more.
• Supported protocols: TCP, SSL,
multicast, HTTP, IMAP and more
• Sample apps: BitTorrent, CIA
Bot, BuildBot, apt-proxy2
83. SQL Database Connection
Z SQL Z SQL Z SQL Z SQL Z SQL Z SQL
Method Method Method Method Method Method
MySQL PgSQL ODBC
Database Database Database
Connection Connection Connection
84. Database Components
HTML WYSWYG Editor
Plone
DTML Page Template Site
Development
and
Search Interface Script Management
Z SQL Method
Database
Zope Connection
MySQLDA PsycopgDA ODBCDA Database
Gadfly Adapter
MySQL PostgreSQL MSSQL
85. Designer Friendly Templates
• Work with WYSIWYG editors
• Zope Page Template (ZPT)
– Template Attribute Language (TAL)
– Macro Expansion Tag Attribute Language (METAL)
XML Namespace
TAL statement
name body
Attribute Attribute Element
Name Value Content
<title tal:content="here/title">Page Title</title>
87. Repeatable Development
editing running with
buildout.cfg bin/buildout
installed as
downloading checking into
product/
package *.egg Python
Package
*.tar.gz Index
88. Build Your Own Project
cd c:
C:plonepythonScriptspaster
create plone3_buildout
MyBuildout
cd MyBuildout
vim buildout.cfg
binbuildout.exe