Download tools/mosesdecoder/mingw/MosesGUI/util.py from Quagmire1/wiki-cased: direct link, hf CLI and curl.
- Browser
- Download file 599 Bytes
-
https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/mingw/MosesGUI/util.py
- Command line
-
hf download hf://Quagmire1/wiki-cased/tools/mosesdecoder/mingw/MosesGUI/util.py
-
curl -L -o util.py https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/mingw/MosesGUI/util.py
599 Bytes
| # -*- coding: utf-8 -*- | |
| import sys | |
| from PyQt4.QtGui import ( | |
| QApplication, | |
| QMessageBox, | |
| ) | |
| def doAlert(text): | |
| msgBox = QMessageBox() | |
| msgBox.setText(text) | |
| msgBox.setWindowTitle("Message") | |
| msgBox.setIcon(QMessageBox.Warning) | |
| msgBox.exec_() | |
| def doQuestion(text): | |
| reply = QMessageBox.question( | |
| None, 'Message', text, QMessageBox.Yes, QMessageBox.No) | |
| if reply == QMessageBox.Yes: | |
| return True | |
| else: | |
| return False | |
| if __name__ == '__main__': | |
| app = QApplication(sys.argv) | |
| doAlert("doAlert") | |
| print doQuestion("doQuestion") | |