Modifying the self made button takeoff on toolbar

How to connect code and connection with takeoff button which I made on Toolbar menu. Can I connect python code with this button which was made? I just made UI but not able to connect with my UI button.pls help me in detail