title: Game function in tkinter(turn based)
body: <p>I am trying to create a GUI for a turn based game, I want one button to say player attack which would then minus a random integer between two set points from another label called monster health. Currently I have set the numbers as normal rather than random to more clearly demonstrate my problem.</p>
  
  <p>I have tried changing formats and importing code from current game file into GUI programme</p>
  
  <pre><code>from Tkinter import *
  import random 
  
  root = Tk()
  
  def phealth():     #playerhealth
      (100) 
  def mhealth(): #monsterhealth
      (99)
  def pheal():    #playerheal
      (rand.randint(10))
  def mheal(): #monsterheal
      (10)
  def pattackf(): #player attack value
      (10) 
  def mattackf(): #monster attack value
      (10) 
  def attackm(): #attack monster
      (mhealth-pattackf)
  def attackp(): #attack player
     (phealth-mattackf)
  def healhm(): #heal monster
      (mhealth+mheal)
  def healp(): #heal player
      (phealth+pheal)
  def middleClick(event):
      mhealth=attackm
  
  print('welcome to monsterland, try not to die')
  print('It is time to name your character, what would you like to be called?')
  player1= raw_input()
  
  playername = Label(root, text = "PLAYER NAME: " + str.upper(player1), fg="Red")
  playername.grid(row=0, column= 2, sticky= "E")
  
  attack = Label(root, text= "Attack Monster")
  attack.grid(row=0,column=0, sticky="W")
  
  attackbutton = Button(root, text = 10)
  attackbutton.grid(row=0,column=1)
  
  
  heal = Label(root, text= "Heal Self")
  heal.grid(row=1,column=0, sticky="W")
  
  healbutton = Button(root, text = 12)
  healbutton.grid(row=1,column=1)
  
  playerhealth = Label(root, text= "Player Health")
  playerhealth.grid(row=2,column=0, sticky="W")
  
  phealthdisplay = Label(root,text= 100)
  phealthdisplay.grid(row=2,column=1)
  
  
  monsterhealth = Label(root, text= "Monster Health")
  monsterhealth.grid(row=3,column=0, sticky="W")
  
  mhealthdisplay = Label(root, text= 100)
  mhealthdisplay.grid(row=3,column=1)
  
  
  
  
  
  root.geometry('500x500')
  #root.configure(background='Red')
  
  
  root.mainloop()
  </code></pre>
  
  <hr>
  
  <p>I would like to be able to press player attack and minus from mhealthdisplay I would also like to press player heal and plus heal button value to player health the def functions above are attempts that I have used in equations though have removed as they don't work left up there to demonstrate current attempts. Thank you.</p>