sorry! Yes it's work. What about 2 question? Can i put function after main block? print qq() def qq(): return 'hello' Traceback (most recent call last): File "C:\Python25\projects\indexer\test.py", line 1, in <module> print qq() NameError: name 'qq' is not defined Or onli possible: def main(): print qq() def qq(): return 'hello' main()