pyqt 显示html网页内容

import sys
from PyQt5.QtWidgets import QApplication, QMessageBox

def display_html(html_content):
    app = QApplication(sys.argv)
    
    msg_box = QMessageBox()
    msg_box.setWindowTitle("HTML Display")
    msg_box.setTextFormat(1)  # 设置文本格式为 HTML
    msg_box.setText(html_content)
    msg_box.exec_()

if __name__ == "__main__":
    html_content = '''
    
    
    
        Display HTML
    
    
        

Hello, Python!

This is HTML content displayed using PyQt5.

'''
display_html(html_content)

你可能感兴趣的:(pyqt,html,前端)