background preloader

Python

Facebook Twitter

7 Python Libraries you should know about. Introduction to OOP with Python. Object Oriented Programming (The image was produced by the University of Canterbury Software Engineering and Visualisation Group as part of their research on OO software visualization.)

Introduction to OOP with Python

I've been programming with Python for over two years now . I had done some procedural programming about eight years previously - but I wasn't familiar with objects or OOP. The whole design philosophy of Python encourages a clean programming style. Its basic datatypes and system of namespaces makes it easier to write elegant, modular code . These factors, and the unique block structure by indentation rule, make Python an ideal first language. In fact the basic principles of object oriented programming are relatively easy to learn. This article assumes a basic knowledge of Python syntax. Objects and OOP are at the heart of the way Python works. So What is an Object ? What is an Object ? In Python the basic elements of programming are things like strings, dictionaries, integers, functions, and so on ... Hint. Code Like a Pythonista: Idiomatic Python.

In this interactive tutorial, we'll cover many essential Python idioms and techniques in depth, adding immediately useful tools to your belt.

Code Like a Pythonista: Idiomatic Python

There are 3 versions of this presentation: ©2006-2008, licensed under a Creative Commons Attribution/Share-Alike (BY-SA) license. My credentials: I am a resident of Montreal,father of two great kids, husband of one special woman,a full-time Python programmer,author of the Docutils project and reStructuredText,an editor of the Python Enhancement Proposals (or PEPs),an organizer of PyCon 2007, and chair of PyCon 2008,a member of the Python Software Foundation,a Director of the Foundation for the past year, and its Secretary. In the tutorial I presented at PyCon 2006 (called Text & Data Processing), I was surprised at the reaction to some techniques I used that I had thought were common knowledge. Many of you will have seen some of these techniques and idioms before. These are the guiding principles of Python, but are open to interpretation. Import this. Guide to Python introspection. What is introspection?

Guide to Python introspection

In everyday life, introspection is the act of self-examination. Introspection refers to the examination of one's own thoughts, feelings, motivations, and actions. The great philosopher Socrates spent much of his life in self-examination, encouraging his fellow Athenians to do the same. He even claimed that, for him, "the unexamined life is not worth living. " (See Resources for links to more about Socrates.) In computer programming, introspection refers to the ability to examine something to determine what it is, what it knows, and what it is capable of doing. This article introduces the introspection capabilities of the Python programming language.

We'll begin our exploration of Python introspection in the most general way possible, before diving into more advanced techniques. So let's begin our inquiry, using Python interactively. Listing 1. Back to top Python's online help utility Listing 2. Listing 3. >>> help() Welcome to Python 2.2! Listing 4. Listing 5. Why PHP Is Fun and Easy But Python Is Marriage Material.