-
Notifications
You must be signed in to change notification settings - Fork 1
/
housie.py
39 lines (30 loc) · 1.06 KB
/
housie.py
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
import os
import pdb
import random
import win32com.client
visio_handle = win32com.client.Dispatch("Visio.Application")
application = visio_handle.Application
documents = visio_handle.Documents
__location__ = os.path.realpath(
os.path.join(os.getcwd(), os.path.dirname(__file__)))
current_document = documents.Open(
os.path.join(__location__, 'Housie.vsdx'))
active_page = application.ActivePage
unrevealed = [i for i in range(1, 91)]
random.shuffle(unrevealed)
print('Welcome to Visio Housie!')
active_page.Shapes[3].Text = ''
while len(unrevealed):
print('Press <Return> for new number or s <Return> for Shuffle ', end='')
inp = input()
if inp == 's':
random.shuffle(unrevealed)
else:
current_number = unrevealed[0]
unrevealed = unrevealed[1:]
active_page.Shapes[0].Text = current_number
if active_page.Shapes[3].Text == '':
active_page.Shapes[3].Text = str(current_number)
else:
active_page.Shapes[3].Text = active_page.Shapes[3].Text + ', ' + str(current_number)
print('Thank you for playing Visio Housie!')