import sys
from PyQt5 import QtCore
class Window(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle('备忘录')
self.resize(500,500)
self.setWindowFlags(QtCore.Qt.SplashScreen | QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint)
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
self.setStyleSheet("background:transparent;")
self.setup_ui()
def setup_ui(self):
label = QLabel(self)
label.setStyleSheet('font-size:36px;color:red')
label.setText(remind_text)
if __name__ == '__main__':
app = QApplication(sys.argv)
remind_text = open(r'example.txt', 'rt',encoding = "utf-8" ).read()
window = Window()
window.show()
sys.exit(app.exec_())