Java Thread Example Code Python