Wednesday, April 30, 2008

Python

Recently, I started to learn Python script language through Python Tutorial. It is a very interesting programming language. It is very powerful and unique. The reason I have interest in Python is that I read an article about Google's open source project. It mentioned that Google promotes this open source language. After reading several sections in the tutorial, I really like Python.

Another reason is that Apple's OS installs Python by default. It is a script language used as Apple's script language. I am going to learn and write some scripts. Python may be a good choice.

I just read a section about Class in Python. Within a Class, there are two types of members, one for attributes and another for methods. You don't need to define all the methods in a class. You can add or delete attributes to a class dynamically. It is really convenient. However, if you defines a attribute, you cannot dynamically to delete it.

Regarding del statement, you can use it to delete a definition of a class as well. If you create an instance of a class and then delete the class, the instance still works For example, you can still call the instance's attributes or methods. I think that the instance is created in memory like an object. In Python, every thing is object.

0 comments: