diff --git a/lab1/lab1.py b/lab1/lab1.py index 6eb0bde..1568890 100644 --- a/lab1/lab1.py +++ b/lab1/lab1.py @@ -1,8 +1,16 @@ import wx +from docx import Document class Ttheory(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) + self.doc_text = wx.StaticText(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0) + + + def get_theor(self): + doc = Document('test1.docx') + text_doc = doc.paragrapghs() + self.doc_text.SetLabel(text_doc) class Labs(wx.Panel): diff --git a/main.py b/main.py index 667c9a1..b8f38de 100644 --- a/main.py +++ b/main.py @@ -48,9 +48,6 @@ class MainPage(wx.Frame): nxt_page.Show() nxt_page.Destroy() - - - app = wx.App(False) frame = MainPage(None) frame.Show() diff --git a/service/test1.py b/service/test1.py new file mode 100644 index 0000000..b6bb955 --- /dev/null +++ b/service/test1.py @@ -0,0 +1,8 @@ +from docx import Document + +doc = Document('test.docx') +full_text = [] +for i in doc.paragraphs: + full_text.append(i.text) + +print(full_text) \ No newline at end of file diff --git a/test.docx b/test.docx new file mode 100644 index 0000000..b2fca96 Binary files /dev/null and b/test.docx differ