View Single Post
Old 01-07-2018, 10:43 AM   #262
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,741
Karma: 24031403
Join Date: Dec 2010
Device: Kindle PW2
I don't know why your code doesn't work, but if all you need is a message box, you might as well use PyQt5, which is bundled with Sigil 0.9.8 and higher.:

Code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtWidgets import QApplication, QMessageBox
   
def run(bk):
    print('Start\n')
    app = QApplication(sys.argv)

    msg = QMessageBox()
    msg.setWindowTitle("QMessageBox demo")
    msg.setText("This is a QMessageBox.")
    msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
    buttonClicked = msg.exec_()
    
    if buttonClicked == QMessageBox.Ok:
        print('\nYou clicked OK.')
    else:
        print('\nYou clicked Cancel.')
    
    print('\nEnd')
    
    return 0
        
def main():
    print('I reached main when I should not have\n')
    return -1

if __name__ == "__main__":
    sys.exit(main())
Doitsu is offline   Reply With Quote