Created
September 21, 2019 01:36
-
-
Save AlecLangford/92d265e06604583ff18faded6819e683 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from docx import Document | |
from docx.shared import Inches | |
from docx.enum.table import WD_TABLE_ALIGNMENT | |
import docx.enum.table | |
from docx.enum.text import WD_ALIGN_PARAGRAPH | |
import random | |
document = Document() | |
all_acts=[ | |
"Automated", | |
"Visibility", | |
"Threat(s)", | |
"Real-time", | |
"Intelligence", | |
"Platform", | |
"ML + AI", | |
"Advanced", | |
"Comprehensive", | |
"Cyber", | |
"Insights", | |
"Context", | |
"Behavioral", | |
"Scalable", | |
"Seamless", | |
"Empower", | |
"Simple/Simplifies", | |
"Unknown", | |
"Orchestrated", | |
"Actionable", | |
"Workflow", | |
"Deep", | |
"Discover", | |
"Prioritization", | |
] | |
for item in range(6): | |
random.shuffle(all_acts) | |
acts=all_acts[:24] | |
acts.insert(12,"Free!") | |
document.add_heading('Cyber conference bingo', 0) | |
table = document.add_table(rows=5, cols=5) | |
table.style = 'TableGrid' | |
table.autofit = False | |
for r in table.rows: | |
r.height = Inches(1) | |
for item in (r.cells): | |
item.text=acts.pop() | |
item.vertical_alignment = docx.enum.table.WD_CELL_VERTICAL_ALIGNMENT.CENTER | |
item.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.CENTER | |
document.add_page_break() | |
document.save('bingo.docx') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment