| Author: | Catherine Devlin |
|---|---|
| Location: | Ohio LinuxFest |
| Date: | Oct. 11, 2008 |
Slides & code at catherinedevlin.blogspot.com
Rerun of OLF 2007 talk
No new content
Writing code?
Reading code!
READABLE
"Ubuntu prefers the community to contribute work in Python."
www.ubuntu.com/community/developerzone/bounties
"If you are planning to develop an application or courseware for the OLPC, then you should use the OLPC Python Environment to build it."
wiki.laptop.org/go/Getting_involved_in_OLPC
start at raw prompt
name = 'earth'
Interactive:
dynamic typing
introspection
visual is a module specifically downloaded & installed
function definitions
indentation
arguments
Small core
Your distro's repository
Lists:
[1, 2, 'buckle my shoe']
Tuples:
(3, 4, 'shut the door')
Dicts:
roman = {1: 'I', 2: 'II', 'one': 'I'}
roman['one']
dict(earth='harmless')
( go play )
fn() calls fn; fn just points to it:
>>> "shout".upper() 'SHOUT' >>> "mumble".upper <built-in method upper of str object at 0xb7d13040>
>>> s = 'shout' >>> funcs = s.upper, s.title, s.isalpha >>> funcs (<built-in method upper of str object at 0xb7d43d00>, <built-in method title of str object at 0xb7d43d00>, <built-in method isalpha of str object at 0xb7d43d00>) >>> for func in funcs: ... func() 'SHOUT' 'Shout' True
It's already been written!
- Python Standard Library
- Cheese Shop
- Know the community
Tutorial www.python.org
Topic Guides
Python Cookbook
iPython: enhanced interactive prompt
No differences
subset of Standard Library
subset of 3rd-party modules
all FCL, Java libraries, etc.
Jim Hugunin IronPython video
PyOhio 2009
Columbus
Summer 2009
pyohio.org
PyCon 2009
Chicago
March 27 - 29
us.pycon.org
That's just 369 miles from here!
Join centralOH@python.org
Bruce
visual