Debian Codegraph @

planetary_system_stacker/Test_programs/gui_with_label_test.py

raw symbols SCIP
1 # -*- coding: utf-8 -*-
2
3 from sys import argv
4 from urllib import request
5
6 from PyQt5 import QtWidgets
7 from PyQt5.QtCore import Qt
8
9 from gui_with_label import Ui_Form
10
11
12 class LabelGui(QtWidgets.QWidget, Ui_Form):
13 def __init__(self):
14 """
15 Initialization of the widget.
16 """
17 super(LabelGui, self).__init__()
18 self.setupUi(self)
19
20 self.label.setTextFormat(Qt.MarkdownText)
21
22 # md = self.get_markdown()
23
24 md = """
25 # Demo
26
27 ### Quickstart Guide
28
29 Hier Text
30
31 #### Configuration
32
33 Hier Text (es folgen hier drei Leerzeichen)
34 Mit Umbruch
35 """
36
37 self.label.setText(md)
38 markdown_text = md.encode()
39 print (str(markdown_text))
40
41 def get_markdown(self):
42 url = 'file:..\quickstart.md'
43 response = request.urlopen(url)
44 return response.read().decode()
45
46
47 if __name__ == '__main__':
48 app = QtWidgets.QApplication(argv)
49 window = LabelGui()
50 window.show()
51 app.exec_()