2. Agenda
History of Python
Python Features
Python as Research Workbench
Python for Web Development
Python Community
Conclusion
組內報告 2012/10/30 2
4. A follow-up Question:
What will happen
if users can
program their
own computer?
組內報告 2012/10/30 4
5. History of Python
Guido van Rossum created
Python when he was working at
CWI (Centrum Wiskunde &
Informatica) during 1989 - 1991
組內報告 2012/10/30 5
6. Python Chronology
CP4E 2009
Programming as Education
a Literacy 2004
2001
CNRI Commercial
1995
1994
CWI 1989
comp.lang.python
Research
組內報告 2012/10/30 6
7. The Year When My Script Looks Like…
use CGI;
my $q = CGI->new();
say $q->header(), $q->start_html();
say "<h1>Parameters</h1>";
for my $param ($q->param()) {
my $safe_param = $q->escapeHTML($param);
say "<p><strong>$safe_param</strong>: ";
for my $value ($q->param($param)) {
say $q->escapeHTML($value);
}
say '</p>';
}
say $q->end_html();
組內報告 2012/10/30 7
8. My Brain Just Hardly Fits Them…
my $q%&*#@->{~(,)};
Even Worse…
inconsistent coding style?
組內報告 2012/10/30 8
9. Python Features: Easy to Learn
if ’smiths’ in RegisterList:
sendNote(‘VIP registered’)
elif ’doe’ not in RegisterList:
startPlan(‘B’)
else:
print len(RegisterList)
length() will return # of elements
組內報告 2012/10/30 9
10. Python Features: Indentation
if ’smiths’ in RegisterList:
sendNote(‘VIP registered’)
elif ’doe’ not in RegisterList:
startPlan(‘B’)
else:
print(len(RegisterList))
Indentation with white spaces
組內報告 2012/10/30 10
11. Readability counts
Programs are meant to be
read by humans and only
incidentally for computers
to execute -- Donald Knuth
組內報告 2012/10/30 11
12. The Zen of Python, by Tim Peters
There should be one –
and preferably only one –
obvious way to do it.
Toward Pythonic Thinking
• Having one way to do it is an advantage.
Once the idioms are hardwired in your brain,
you’d have instant recognition.
組內報告 2012/10/30 12
13. Python as Research Workbench
Pythonmakes it easy to balance high-level
programming with low-level optimization.
Python excels at gluing other languages.
Numerous libraries provide the needed
functionality for scientific.
Python incorporates documentation and
testing directly into the language itself.
組內報告 2012/10/30 13
17. Python for Web Development
Common Ways to Have Your Web Sites:
• Building Them with Frameworks
• Building Them with CMSes
Your
You Website
are here
here
組內報告 2012/10/30 17
18. Plone, a Python based CMS
CMS = Contents Stored in Database
Added/Edited by User/Group
Managed with Workflow
Searchable via Index/Catalog
or simply…
Forms in Database
組內報告 2012/10/30 18
19. Form Elements
CMS = Contents Stored in Database
Added/Edited by User/Group
Managed with Workflow
Searchable via Index/Catalog
組內報告 2012/10/30 19
25. The Python Paradox, by Paul Graham
• You could get smarter programmers to work
on a Python project than you could to work
on a Java project.
• If a company chooses to write its software in
a comparatively esoteric language, they'll be
able to hire better programmers, because
they'll attract only those who cared enough
to learn it.
• The language to learn, if you want to get a
good job, is a language that people don't
learn merely to get a job.
組內報告 2012/10/30 25
26. Conclusion
Python serves well as the first language to
learn, even better as the glue when
working with other languages or tools.
It helps to improve team productivity.
Get more: Extending with C/C++ or
Embedding in Applications
Google Engineering Decision:
Python where we can, C++ where we must
組內報告 2012/10/30 26