rewrite MainWindow.py