This is behavior common to pretty much all GUI's. Your callback function triggered by a button click should run in a new thread, or spawn a new thread in which the networking code runs. Check out the threading and thread modules.