Python is a language that can be described as:
"which you can put in the palm of your hand with a huge bag of hooks."
Almost everything in python follows the same simple standards. Everything is accessible, interchangeable and customizable. Very few language level elements.
Take, for example, the built-in len (data) function. len(data) works by simply checking the data.__len__() method, and then calling it and returning a value. Thus, len() can work with any object that implements the __len__() method.
Start by exploring types and basic syntax:
- Dynamic strongly typed languages
- bool, int, float, string, list, tuple, dict, set
- indentation, "everything is an object"
- definitions of core functions
Then, let's move on to how python works:
- imports and modules (really simple)
- python path (sys.path)
dir() function__builtins__
Once you understand how to put together the parts, go back and look at some of the more advanced features of the language:
- iterators
- overrides how
__len__ (there are many) - list of concepts and generators
- classes and objects (again, really simple, as soon as you know a couple of rules)
- python inheritance rules
And as soon as you have a level of comfort with these elements (with an emphasis on what makes them pythonic), look at more specific items:
- Threading in python (note the Global Interpreter lock)
- context managers
- access to the database
- IO file
- sockets
- etc...
And never forget Zen Python (Tim Peters)
Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let do more of those!
gahooa Aug 04 '09 at 1:38 2009-08-04 01:38
source share