-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
51 lines (35 loc) · 1.31 KB
/
tests.py
File metadata and controls
51 lines (35 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# from docx import Document
# from docx.shared import Pt
# from docx.enum.text import WD_PARAGRAPH_ALIGNMENT
# # Define the filename with date and time
# from datetime import datetime
# now = datetime.now().strftime("%Y-%m-%d %H-%M-%S")
# file_name = f"Расшифровка итоговая от {now}.docx"
# # Create a new document
# doc = Document()
# # Set title
# title = f"Расшифровка итоговая от {now}"
# title_paragraph = doc.add_paragraph(title)
# title_paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER
# # Format title
# title_run = title_paragraph.runs[0]
# title_run.font.name = "Calibri"
# title_run.font.size = Pt(16)
# title_run.bold = True
# # Add body text
# body_text = "Здесь идет основной текст документа..."
# body_paragraph = doc.add_paragraph(body_text)
# # Format body text
# body_run = body_paragraph.runs[0]
# body_run.font.name = "Calibri"
# body_run.font.size = Pt(11)
# body_run.bold = True
# ran2= body_paragraph.add_run('ALIiisaidiasjd')
# ran2.bold=False
# # Remove paragraph spacing (before & after)
# for paragraph in doc.paragraphs:
# paragraph.paragraph_format.space_before = Pt(0)
# paragraph.paragraph_format.space_after = Pt(0)
# # Save the document
# doc.save(file_name)
# print(f"Document saved as: {file_name}")