How To Close A Thread In Python