Matt, as I look at your initial GUI code I can see two problems not related to Tkinter. I marked them with # !!!!!!!!!!!!!!!!, those will be errors!
[php]from Tkinter import *
def addMen():
addMenC = input("Where do you wish to add men? (country 1,2,3 or 4):")
addMenLoop = True
c1a = 0
c2a = 0
c3a = 0
c4a = 0
while addMenLoop:
if addMenC == 1:
c1a += 3
# !!!!!!!!!!!!!!!!!
# country1Label was defined outside the function
# and is not known inside this function
# dito for the three other labels
country1Label.configure(text = str(c1a))
break
elif addMenC == 2:
c2a += 3
country2Label.configure(text = str(c2a))
break
elif addMenC == 3:
c3a += 3
country3Label.configure(text = str(c3a))
break
elif addMenC == 4:
c4a += 3
country1Label.configure(text = str(c4a))
break
riskWindow = Tk()
riskWindow.title("Risk")
country1TitleLabel = Label(riskWindow, text="Country 1", width=30)
country1TitleLabel.grid(row=0, column=0)
country2TitleLabel = Label(riskWindow, text="Country 2", width=30)
country2TitleLabel.grid(row=0, column=1)
country3TitleLabel = Label(riskWindow, text="Country 3", width=30)
country3TitleLabel.grid(row=2, column=0)
country4TitleLabel = Label(riskWindow, text="Country 4", width=30)
country4TitleLabel.grid(row=2, column=1)
# !!!!!!!!!!!!!!!!!!!!!!!!!
# c1a was defined in the function, but is not known outside the function
# dito for c2a, c3a, c4a in the lines that follow
country1Label = Label(riskWindow, text=str(c1a), width=30)
country1Label.grid(row=1, column=0)
country2Label = Label(riskWindow, text=str(c2a), width=30)
country2Label.grid(row=1, column=1)
country3Label = Label(riskWindow, text=str(c3a), width=30)
country3Label.grid(row=3, column=0)
country4Label = Label(riskWindow, text=str(c4a), width=30)
country4Label.grid(row=3, column=1)
armyButton = Button(riskWindow, text="Add men to a country", command=addMen)
armyButton.grid(row=4, column=0)
riskWindow.mainloop()
[/php]
Now, you could make all those variables global for the function.
[php]from Tkinter import *
def addMen():
# make these labels global so they can be used in the function
global country1Label
global country2Label
global country3Label
global country4Label
# make these variables global, so changes transfer out
global c1a, c2a, c3a, c4a
addMenC = input("Where do you wish to add men? (country 1,2,3 or 4):")
addMenLoop = True
while addMenLoop:
if addMenC == 1:
c1a += 3
country1Label.configure(text = str(c1a))
break
elif addMenC == 2:
c2a += 3
country2Label.configure(text = str(c2a))
break
elif addMenC == 3:
c3a += 3
country3Label.configure(text = str(c3a))
break
elif addMenC == 4:
c4a += 3
country1Label.configure(text = str(c4a))
break
riskWindow = Tk()
riskWindow.title("Risk")
c1a = 0
c2a = 0
c3a = 0
c4a = 0
country1TitleLabel = Label(riskWindow, text="Country 1", width=30)
country1TitleLabel.grid(row=0, column=0)
country2TitleLabel = Label(riskWindow, text="Country 2", width=30)
country2TitleLabel.grid(row=0, column=1)
country3TitleLabel = Label(riskWindow, text="Country 3", width=30)
country3TitleLabel.grid(row=2, column=0)
country4TitleLabel = Label(riskWindow, text="Country 4", width=30)
country4TitleLabel.grid(row=2, column=1)
country1Label = Label(riskWindow, text=str(c1a), width=30)
country1Label.grid(row=1, column=0)
country2Label = Label(riskWindow, text=str(c2a), width=30)
country2Label.grid(row=1, column=1)
country3Label = Label(riskWindow, text=str(c3a), width=30)
country3Label.grid(row=3, column=0)
country4Label = Label(riskWindow, text=str(c4a), width=30)
country4Label.grid(row=3, column=1)
armyButton = Button(riskWindow, text="Add men to a country", command=addMen)
armyButton.grid(row=4, column=0)
riskWindow.mainloop()
[/php]
The next issue will be that input() happens in the command window, and you have to switch back and forth between the tk window and the command winow. You will get tired of that real quick, that's where the entry widget comes to the rescue. Now your input happens in the tk window. By the way, Tkinter also has a spinbox widget and you can make the value jump by three on every click of the up arrow.
Anyway, happy explorations! Best way to learn!