I was shown this cool technique earlier this evening thanks to another member on stackoverflow. I am a beginner at python, so most of my learning is done through reading this book I have and editing code to see how it would work.
I'm trying to design this for the bottom of the menu:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X TASK1 X TASK2 X TASK3 X TASK4 X TASK5 X
X [ ] X [ ] X [ ] X [ ] X [ ] X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
So you basically see this:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X X
X TASK MANAGER - TASK SELECTION X
X X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X X
X READY TO START? X
X --------------------- X
X PRESS THE 'ENTER' X
X KEY TO BEGIN! X
X --------------------- X
X X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X TASK1 X TASK2 X TASK3 X TASK4 X TASK5 X
X [ ] X [ ] X [ ] X [ ] X [ ] X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The purpose of the bottom part would be that if you select say task 2, it would then just print a function for whichever is selected...so it would be (if task 2 selected):
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X X
X TASK MANAGER - TASK SELECTION X
X X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X X
X READY TO START? X
X --------------------- X
X PRESS THE 'ENTER' X
X KEY TO BEGIN! X
X --------------------- X
X X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X TASK1 X TASK2 X TASK3 X TASK4 X TASK5 X
X [ ] X [X] X [ ] X [ ] X [ ] X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Here is the current code:
def printLine (text = ''):
print('X {: ^47} X'.format(text))
def printSelTitle (text = '', title = None):
print('X{: ^9}'.format(text)),
def printSelCheck (text = '', title = None):
print('X [ ] X'.format(text)),
def printBorder (title = None):
print('X' * 51)
def printBox (*lines, title = None, showBottomBorder = False):
printBorder(title)
printLine()
for line in lines:
printLine(line)
printLine()
if showBottomBorder:
printBorder()
printBox('TASK MANAGER - TASK SELECTION')
printBox('READY TO START?', '-' * 21, "PRESS THE 'ENTER'",\
'KEY TO BEGIN!', '-' * 21, showBottomBorder = True)
printSelTitle('TASK1') and printSelTitle('TASK2')
printSelCheck()
printBorder()
printSelTitle('TASK3')
printSelTitle('TASK4')
printSelTitle('TASK5')
Here is what the current code looks like:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X X
X TASK MANAGER - TASK SELECTION X
X X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X X
X READY TO START? X
X --------------------- X
X PRESS THE 'ENTER' X
X KEY TO BEGIN! X
X --------------------- X
X X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X TASK1
X [ ] X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X TASK3
X TASK4
X TASK5
Any thoughts? Thanks in advance for any help.
Best,
Steven