I working on a notepad clone. While saving a file is a straight forward, I am a bit stuck with the following issue: QFileDialog.getSavefile() always prompt user to save file even if the the file was saved earlier and no changes have been made to it. How do I make my notepad smart to ignore save command if no changes have been made to the file? Just like the real notepad in windows. Here is the extract of my save function from my project: def save_file(self): """ Saves the user's work. :return: True if the saving is successful. False if otherwise """ options = QFileDialog.Options() options |= QFileDialog.DontUseNativeDialog file_name, _ = QFileDialog.getSaveFileName(self,"Save File","","All Files(*);;Text Files(*.txt)",options = options) if file_name: f = open(file_name, 'w') text = self.ui.textEdit.toPlainText() f.write(text) self.setWindowTitle(str(os.path.basename(file_name)) + " - Notepad Alpha") f.close() return True else: return False Continue reading...