We can write a piece of python code and put it in already compiled ".pyc" file and use it. I am wondering that is there any kind of gain in terms of performance or it is just a kind of modular way of grouping the code. 
Thanks a lot
Yes, simply because the first time you execute a .py file, it is compiled to a .pyc file. 
So basically you have to add the compilation time. Afterwards, the .pyc file should be always used.
is there any kind of performance gain while using .pyc files in python?