some programming practices by using python2.7