본문 바로가기
Programming/Python

[Python] PyQt5 메시지 박스 / QMessageBox

by Skogkatt의 개인 블로그 2020. 1. 14.
반응형

PyQt5 메시지 박스 / QMessageBox

from PyQt5.QtWidgets import *
def show_message_box(self, title, message): # title = 메시지 박스 타이틀, message = 메시지 박스 내용
msg_box = QMessageBox(self)
msg_box.question(self, title, message, QMessageBox.Yes | QMessageBox.No) # Yes or No
def box(self):
self.show_message_box(title='title',message='message')

 

def show_message_box(self, title, message): # title = 메시지 박스 타이틀, message = 메시지 박스 내용
msg_box = QMessageBox(self)
msg_box.question(self, title, message, QMessageBox.Ok | QMessageBox.No) # OK or No
  • | 기호를 사용해 여러 버튼을 표시할 수 있다.

 

참고 링크
http://www.reversenote.info/qmessagebox-example/
반응형

댓글