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
I'm not sure about .pyc files (very minor gain is at least not creating .pyc files again), but there's a '-O' flag for the Python interpreter which produces optimised bytecode (.pyo files).
is there any kind of performance gain while using .pyc files in python?