How To Apply Threading In Python