krish – 起死回生 [Wake up from death & return to life.]

December 4, 2008

Document your python functions

Filed under: Programming — krish @ 12:19 am
Tags: , ,

Many people tend to ignore commenting and documenting the code they write. The small amounts of invested time can make life ease for others; especially if you are a crappy coder like me! 🙂

In python, to document your functions, give it a doc string. Doc strings are the first triple quoted string you’d want in a function.

def mySmallFunction(myParams):
      """ Does nothing. Just a time consuming run. """
      return ";)"

if __name__ == "__main__":
     myParams = {"":"dummy"}
     print mySmallFunction(myParams)

In the python interpreter, doc strings can be accessed by calling attribute __doc___

>>> import test
>>> test.mySmallFunction.__doc__
' Does nothing. Just a time consuming run. '

December 30, 2007

ah python!

Filed under: Programming — krish @ 11:26 am
Tags: ,

I’ve been writing few newbie programs in python since yesterday. 😉
My ISP’s DNS was not looking up for and I had to spend few extra minutes getting the IP and accessing the ftp docs. (thanks to friends at #python @ freenode)

Few good things for me with this snake, er.. language/interpreter
1. No delimiter ( I have a bad habit of forgetting ; in my C, C++, perl, php code )
2. No angular brackets for condition statements
3. Free form language ( first encountered this in perl )

Most of the times, I am finding myself tempted to compare python code with perl; hopefully I shall get over it with time.

Talking about time, I just remembered – its time for LUG meet and I need to hurry! 😛

Create a free website or blog at

Rough Draft

by Atteris Amarth and Darrek Ringo

The Kochi Post.

Read by all + Influenced by none


A signature of Kiran


This blog is just for additional and extension share of it's main frames. No activity is planned from here

krish - 起死回生 [Wake up from death & return to life.]

Get a sneak peek into krish's life, work and passion. is the best place for your personal blog or business site.

A Tale of Two and a Half

Monika Amita Bakshi

%d bloggers like this: