View Single Post
Old 04-08-2020, 03:15 PM   #12
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,738
Karma: 24031403
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by carmenchu View Post
But my search into PyQt documentation has devolved into headache.
The Qt documentation really isn't great, by PyQt can also be relatively simple if you stick to basic controls. For example, this post shows how to display a message box.

Displaying an input box is even easier:
Spoiler:
Code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtWidgets import QApplication, QInputDialog
from PyQt5 import QtCore

def run(bk):
    app = QApplication(sys.argv)
    input = QInputDialog()
    input.setWindowFlags(QtCore.Qt.WindowCloseButtonHint) # hide "What is this?" icon [?]
    input.setWindowTitle("QInputDialog demo")
    button_clicked = input.exec_()
    print("You entered:", input.textValue())
    
    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