28
Python 101 for the .NET Developer Sarah Dutkiewicz http://www.clevelanddotnet. info

Python 101 For The Net Developer

Embed Size (px)

DESCRIPTION

Given on Tuesday, June 23, 2009 at the Greater Cleveland PC Users Group C#/VB.NET SIG. A very basic intro to Python given to a .NET crowd with the assumption of little to no Python experience.

Citation preview

Page 1: Python 101 For The Net Developer

Python 101 for the .NET Developer

Sarah Dutkiewicz

http://www.clevelanddotnet.info

Page 2: Python 101 For The Net Developer

What is Python?

Page 3: Python 101 For The Net Developer

What is Python?

Page 4: Python 101 For The Net Developer

What is Python?

Page 5: Python 101 For The Net Developer

What is Python?

Python is a dynamic object-oriented programming language that can be used for many kinds of software development. It offers strong support for integration with other languages and tools, comes with extensive standard libraries, and can be learned in a few days.

- Taken from the official Python site, python.org

Page 6: Python 101 For The Net Developer

Who’s Using Python?Python plays a key role in our production pipeline. Without Python a project the size of Star Wars: Episode II would have been very difficult to pull off. From crowd rendering to batch processing to compositing, Python binds all things together. -- Tommy Burnette

Page 7: Python 101 For The Net Developer

Who’s Using Python?

Python has been an important part of Google since the beginning. -- Peter Norvig.

http://code.google.com/appengine/Python application servers and Python scripting to create the web UI for BigTable (their database project)

Page 8: Python 101 For The Net Developer

Who’s Using Python?

We chose Python because it provides maximum productivity, code that's clear and easy to maintain, strong and extensive (and growing) libraries, and excellent capabilities for integration with other applications on any platform. -- Steve Waterbury

Workflow automation servers

Page 9: Python 101 For The Net Developer

More Python in Action

Page 10: Python 101 For The Net Developer

Features of Python

•Free and open source• Great first language

• Availability (cross-platform)• Interactivity (interpreted

language)• Simplicity

•Scalable – can play nicely with other languages•GUI support – GUIs typically developed with Tk

Page 11: Python 101 For The Net Developer

Python’s Weaknesses

• Can be slower than compiled C or C#• Relies on a locking mechanism called the Global Interpreter Lock (GIL) in multi-threading

• Implementations in other languages get around – specifically Jython and IronPython

Page 12: Python 101 For The Net Developer

Implementations

• CPython - implemented in C, the primary implementation• Jython - implemented for the JVM• Pypy - implemented in Python• IronPython - implemented in C#, allows python to use the .NET libraries

Page 13: Python 101 For The Net Developer

What is IronPython?

IronPython is the open source .NET implementation of the Python programming language, giving Python programmers the benefits of the .NET libraries while still maintaining compatibility with straight Python.

Page 14: Python 101 For The Net Developer

Modules

• Databases– PyGreSQL (PostGreSQL)– MySQLdb (MySQL)– cx_Oracle (Oracle)

• Instant Messaging– Pymsn (MSN Messenger)– Jabberpy (Jabber)

Page 15: Python 101 For The Net Developer

More Modules

PyOpenGL

Page 16: Python 101 For The Net Developer

More Modules

• Graphics (gdmodule, VideoCapture, PIL)• Math & Science (scipy, NumPy, numarray, matplotlib)• Hardware

– Serial ports (pySerial, USPP)

– Parallel port (pyParallel)

Page 17: Python 101 For The Net Developer

Frameworks

• PyCon (http://www.pycon.org)

• SuggestionBox.com

• Curse.com (WoW add-ons)

• BitTorrent

• Reddit

• IMDBTube

• Streetspottings.com

• IM Feeds

Page 19: Python 101 For The Net Developer

XKCD

Page 20: Python 101 For The Net Developer

Demos

Page 21: Python 101 For The Net Developer

User Groups & Events

• Cleveland Python Users Group– First Monday of the month– Past topics include:

• Ingredients for a Python DSL• Dependency Injection Framework• Distributed Issue Tracking• Screenlets for making Linux desktop widgets• Guppy – a memory debugging package

Page 22: Python 101 For The Net Developer

GiveCamp

•What: A weekend of coding charity projects with other geeks•When: July 17-19, 2009•Where: Columbus, OH and Ann Arbor, MI•More info: http://www.columbusgivecamp.org and http://www.michigangivecamp.com/AnnArbor

Page 23: Python 101 For The Net Developer

PyOhio

•What: 2 day conference on Python•When: July 25-26, 2009•Where: The Ohio State University, Knowlton Hall, Columbus, OH•More info: http://pyohio.org or Follow PyOhio on Twitter as @pyohio

Page 24: Python 101 For The Net Developer

Python Web References• Official Python Site: http://www.python.org/

• User Groups & Events– Cleveland Python Users Group: http://clepy.googlegroups.com

– PyOhio: http://www.pyohio.org

– PyCon: http://www.pycon.org

• Modules– 50 Modules for All Needs: http://

www.catswhocode.com/blog/featured/python-50-modules-for-all-needs-10

• Frameworks– Django: http://www.djangoproject.com/

– Pylons: http://pylonshq.com/

Page 25: Python 101 For The Net Developer

•Official IronPython Site: http://www.codeplex.com/ironpython•IronPython Cookbook: http://www.ironpython.info•The Voidspace Techie Blog: http://www.voidspace.org.uk/python/weblog/•DevHawk’s Blog: http://www.devhawk.net/•The Mono Project: http://mono-project.com•FePy and IronPython Community Edition http://fepy.sourceforge.net

IronPython Web References

Page 26: Python 101 For The Net Developer

Python Recommended Reading

• Python Cookbook by Alex Martelli, Anna Ravenscroft, and David Ascher (ISBN: 978-0596007973)

• Python Programming for the Absolute Beginner by Michael Dawson (ISBN: 978-1598631128)

• Core Python Programming by Wesley Chun (ISBN: 978-0132269933)

Page 27: Python 101 For The Net Developer

IronPython Recommended Reading

http://www.ironpythoninaction.com

I recommend technical books typically based on their reference value, as I usually get bored within the first few sentences and end up turning them into references rather than reading through them. This book, however, was one that I read cover-to-cover...Overall, I would recommend IronPython in Action for anyone wanting to learn IronPython.

– Sarah DutkiewiczThe Coding Geekette (reviewed for Manning Publications)