I am trying to print the output answer to my GUI in Tkinter and I can not seem to see how it is possible! If anyone has any tips please let me know. I know its somewhere along the lines of this but I cannot seem to crack it!
DisplayFearFactor.configure( text = " computers FearFactor: " + str(computersCardFearFactor))
DisplayFearFactor.place(bordermode=OUTSIDE, height=60, width=200,x=100,y=100)
here is the full section of code:
def compareFearFactor():
human = []
computer = []
if len(cards) > 0:
human.append(cards.pop(0))
computer.append(cards.pop(0))
humanCard = human.pop(0) if human else None
computersCard = computer.pop(0) if computer else None
print("computers Fear Factor:", computersCard.FearFactor)
Draw = (humanCard.FearFactor == computersCard.FearFactor)
Win = (humanCard.FearFactor > computersCard.FearFactor)
DisplayFearFactor.configure( text = " computers FearFactor: " + str(computersCardFearFactor))
DisplayFearFactor.place(bordermode=OUTSIDE, height=60, width=200,x=100,y=100)
computercardshow = ImageTk.PhotoImage(computersCard.image)
Comp = Label(image = computercardshow)
Comp.configure(image = computercardshow)
Comp.place(x=800,y=50)
Comp.image = computercardshow
if Draw:
print("It's a tie!")
human.append(humanCard)
computer.append(computersCard)
elif Win:
print("You win this hand!")
cards.append(humanCard)
cards.append(computersCard)
playerTurn = True
else:
print("You lose this hand!")
computer.append(computersCard)
computer.append(humanCard)
playerTurn = False