I have come across a very weird problem. In the below code, nothing seems to be wrong but still window freezes after certain percentage is completed in progressbar of tkinte