User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 402,795 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,882 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums
Views: 460 | Replies: 12
Reply
Join Date: May 2008
Posts: 18
Reputation: MikeyFTW is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
MikeyFTW MikeyFTW is offline Offline
Newbie Poster

Combining two python programs together...HELP!!!

  #1  
Jul 18th, 2008
Ok heres the deal they're both a mathematics program but i want to make it like this...

from Tkinter import *
import tkMessageBox
import random

def ask():
    global num1 
    num1 = random.randint(1, 100)
    global num2 
    num2 = random.randint(1, 100)
    global answer 
    answer = num1 + num2
    label1.config(text='What is ' + str(num1) + '+' + str(num2) + '?')

    # put the cursor into the Enter-Box
    entry1.focus_set()
    
def checkAnswer():
    mainAnswer = entry1.get()
    
    # if empty give message
    if len(mainAnswer) == 0:
        tkMessageBox.showwarning(message='Need to enter some numbers!')
        return
    if int(mainAnswer) != answer:
        tkMessageBox.showwarning(message='The correct answer is: ' + str(answer))
    else:
        tkMessageBox.showinfo(message='Correct! :)')

#set the window
root = Tk()
root.title("Mikey's Multiplication Quiz")
root.geometry('500x500')

# welcome message
label2 = Label(root, text="Hi!\n  Let's do some Mathematics problems!")
label2.config(font=('times', 18, 'bold'), fg='black', bg='white')
label2.grid(row=0, column=0)

#add label
label1 = Label(root)
label1.grid(row=2, column=0)

#entry
entry1 = Entry(root)
entry1.grid(row=3, column=0)

# bind the return key
entry1.bind('<Return>', func=lambda e:checkAnswer())

#button
askBtn = Button(root, text='Ask Me a Question!', command=ask)
askBtn.grid(row=4, column=0)

okButton = Button(root, text='OK', command=checkAnswer)
okButton.grid(row=4, column=1)

root.mainloop()

and from this code below implement it to like the one above ^^^^

name = raw_input("\t\t\tPlease Enter Your Name: ")

print
print "\t\t\t\tHello", name
print "\t\t\tWelcome to my Mathematics Game"

# Selecting the operation of Addition and Substraction followed by the difficulty
print
operation = str(raw_input("\t\t\tAddition (A) or Substraction (S)"))
if operation == "A" or operation == "a":
    my_op = 'Add'
    difficulty = str(raw_input("\tSelect a difficulty - Easy (E)(1-100), Medium (M) (1-200) or Hard (H) (1-500)"))
    print
    print "Addition"
    print '** ** **'
    print
elif operation == "S" or operation == "s":
    my_op = 'Sub'
    difficulty = str(raw_input("\tSelect a difficulty - Easy (E)(1-100), Medium (M) (1-200) or Hard (H) (1-500)"))
    print
    print "Subtraction"
    print '** ** ** **'
    print

if difficulty == "Easy" or difficulty == "easy" or difficulty == "E" or difficulty == "e":
    my_rand_range = 100
elif difficulty == "Medium" or difficulty == "medium" or difficulty == "M" or difficulty == "m":
    my_rand_range = 200
elif difficulty == "Hard" or difficulty == "hard" or difficulty == "H" or difficulty == "h":
    my_rand_range = 500

# Amount of questions asked (10) and randomisation of numbers
import random
counter = 0
while counter < 10:
    counter = counter +1

    # Difficulty - Easy, Medium or Hard
    number1 = random.randrange( my_rand_range ) + 1
    number2 = random.randrange( my_rand_range ) + 1

    # Addition Calculations
    if my_op == 'Add':
        print number1, "+", number2, "="
    # Substraction Calculations
    elif my_op == 'Sub':
        print number1, "-", number2, "="

    # Input for answer
    answer = int(raw_input("Type in your answer: "))

    # If Its "Correct" or "Incorrect"
    if ( answer == number1 + number2 and my_op == 'Add' ) or \
        ( answer == number1 - number2 and my_op == 'Sub' ):
        print "Correct :)"
        print
    else:
        print "Incorrect :("
        print

raw_input("\n\nPress the enter key to exit.")

see i want code number 2 to look like code number 1 somehow

Please can anyone figure this out

thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2008
Posts: 1
Reputation: riyadhmehmood is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
riyadhmehmood riyadhmehmood is offline Offline
Newbie Poster

Re: Combining two python programs together...HELP!!!

  #2  
Jul 19th, 2008
hello here
I have got one question.I would like to write a program that deals with Wordnet and Wikipedia.For example i take a word "glass"then there are four artikcle on it but from them only one article has similarity with the synsets of wordnet and that I want to do it with using tf-idf weight(term frequency-inverse document frequency).Can someone help me please?
Last edited by riyadhmehmood : Jul 19th, 2008 at 8:09 am.
Reply With Quote  
Join Date: Aug 2005
Posts: 1,034
Reputation: Ene Uran is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 64
Ene Uran's Avatar
Ene Uran Ene Uran is online now Online
Veteran Poster

Re: Combining two python programs together...HELP!!!

  #3  
Jul 19th, 2008
riyadhmehmood, do not hijack somebody elses thread! Very bad manners. Start your own thread.
drink her pretty
Reply With Quote  
Join Date: Aug 2005
Posts: 1,034
Reputation: Ene Uran is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 64
Ene Uran's Avatar
Ene Uran Ene Uran is online now Online
Veteran Poster

Re: Combining two python programs together...HELP!!!

  #4  
Jul 19th, 2008
MikeyFTW,
looks like you have to study up on Tkinter GUI programming.

Here is an introduction:
http://www.pythonware.com/library/tk...tion/index.htm

In simple terms, create a frame/window/root, input through an Entry, action with a Button and output to a Label.
Last edited by Ene Uran : Jul 19th, 2008 at 11:58 am.
drink her pretty
Reply With Quote  
Join Date: May 2008
Posts: 18
Reputation: MikeyFTW is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
MikeyFTW MikeyFTW is offline Offline
Newbie Poster

Re: Combining two python programs together...HELP!!!

  #5  
Jul 19th, 2008
Originally Posted by Ene Uran View Post
MikeyFTW,
looks like you have to study up on Tkinter GUI programming.

Here is an introduction:
http://www.pythonware.com/library/tk...tion/index.htm

In simple terms, create a frame/window/root, input through an Entry, action with a Button and output to a Label.

please man can you do an example for me so i can learn off towards my program
Reply With Quote  
Join Date: Aug 2005
Posts: 1,034
Reputation: Ene Uran is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 64
Ene Uran's Avatar
Ene Uran Ene Uran is online now Online
Veteran Poster

Re: Combining two python programs together...HELP!!!

  #6  
Jul 20th, 2008
Okay, here is a simple create a window, input through an Entry, action with a Button and output to a Label code example:
  1. # a simple Tkinter number guessing game
  2. # shows how to create a window, an entry, a label, a button,
  3. # a button mouse click response, and how to use a grid for layout
  4.  
  5. from Tkinter import *
  6. import random
  7.  
  8. def click():
  9. """the mouse click command response"""
  10. global rn
  11. # get the number from the entry area
  12. num = int(enter1.get())
  13. # check it out
  14. if num > rn:
  15. label2['text'] = str(num) + " guessed too high!"
  16. elif num < rn:
  17. label2['text'] = str(num) + " guessed too low!"
  18. else:
  19. s1 = str(num) + " guessed correctly!"
  20. s2 = "\n Let's start a new game!"
  21. label2['text'] = s1 + s2
  22. # pick a new random number
  23. rn = random.randrange(1, 11)
  24. enter1.delete(0, 2)
  25.  
  26.  
  27. # create the window and give it a title
  28. root = Tk()
  29. root.title("Heidi's Guess A Number Game")
  30.  
  31. # pick a random integer from 1 to 10
  32. rn = random.randrange(1, 11)
  33.  
  34. # let the user know what is going on
  35. label1 = Label(root, text="Guess a number between 1 and 10 -->")
  36. # layout this label in the specified row and column of the grid
  37. # also pad with spaces along the x and y direction
  38. label1.grid(row=1, column=1, padx=10, pady=10)
  39.  
  40. # this your input area
  41. enter1 = Entry(root, width=5, bg='yellow')
  42. enter1.grid(row=1, column=2, padx=10)
  43. # put the cursor into the entry field
  44. enter1.focus()
  45.  
  46. # this is your mouse action button, right-click it to execute command
  47. button1 = Button(root, text=" Press to check the guess ", command=click)
  48. button1.grid(row=2, column=1, columnspan=2, padx=10, pady=10)
  49.  
  50. # the result displays here
  51. label2 = Label(root, text="", width=50)
  52. label2.grid(row=3, column=1, columnspan=2, pady=10)
  53.  
  54. # start the mouse/keyboard event loop
  55. root.mainloop()
GUI programming takes a moment to get used to!
drink her pretty
Reply With Quote  
Join Date: May 2008
Posts: 18
Reputation: MikeyFTW is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
MikeyFTW MikeyFTW is offline Offline
Newbie Poster

Re: Combining two python programs together...HELP!!!

  #7  
Jul 21st, 2008
Originally Posted by Ene Uran View Post
Okay, here is a simple create a window, input through an Entry, action with a Button and output to a Label code example:
  1. # a simple Tkinter number guessing game
  2. # shows how to create a window, an entry, a label, a button,
  3. # a button mouse click response, and how to use a grid for layout
  4.  
  5. from Tkinter import *
  6. import random
  7.  
  8. def click():
  9. """the mouse click command response"""
  10. global rn
  11. # get the number from the entry area
  12. num = int(enter1.get())
  13. # check it out
  14. if num > rn:
  15. label2['text'] = str(num) + " guessed too high!"
  16. elif num < rn:
  17. label2['text'] = str(num) + " guessed too low!"
  18. else:
  19. s1 = str(num) + " guessed correctly!"
  20. s2 = "\n Let's start a new game!"
  21. label2['text'] = s1 + s2
  22. # pick a new random number
  23. rn = random.randrange(1, 11)
  24. enter1.delete(0, 2)
  25.  
  26.  
  27. # create the window and give it a title
  28. root = Tk()
  29. root.title("Heidi's Guess A Number Game")
  30.  
  31. # pick a random integer from 1 to 10
  32. rn = random.randrange(1, 11)
  33.  
  34. # let the user know what is going on
  35. label1 = Label(root, text="Guess a number between 1 and 10 -->")
  36. # layout this label in the specified row and column of the grid
  37. # also pad with spaces along the x and y direction
  38. label1.grid(row=1, column=1, padx=10, pady=10)
  39.  
  40. # this your input area
  41. enter1 = Entry(root, width=5, bg='yellow')
  42. enter1.grid(row=1, column=2, padx=10)
  43. # put the cursor into the entry field
  44. enter1.focus()
  45.  
  46. # this is your mouse action button, right-click it to execute command
  47. button1 = Button(root, text=" Press to check the guess ", command=click)
  48. button1.grid(row=2, column=1, columnspan=2, padx=10, pady=10)
  49.  
  50. # the result displays here
  51. label2 = Label(root, text="", width=50)
  52. label2.grid(row=3, column=1, columnspan=2, pady=10)
  53.  
  54. # start the mouse/keyboard event loop
  55. root.mainloop()
GUI programming takes a moment to get used to!


Oh cool thanks man this really gave me the idea for my program and i learned alot of how GUI works on my way through as well.

Thanks mate!

But i may need some help from you soon lol
Reply With Quote  
Join Date: May 2008
Posts: 18
Reputation: MikeyFTW is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
MikeyFTW MikeyFTW is offline Offline
Newbie Poster

Re: Combining two python programs together...HELP!!!

  #8  
Jul 21st, 2008
Ok man i am seriously stuck now...

First problem - i cant get the "name input" to work, i have no idea what the code is, i want it to say "Hello, (name)" just below the "OK" button when the user inputs there name and clicks OK.

Second problem - When the user chooses which operation they want, i want it to go to a completely different window for each operation which ive done BUT how do you make it show it in the acutal window???

Any other help will also be appreciated!

from Tkinter import *
import random

# create the window and give it a title
root = Tk()
root.title("Main Menu - Mathematics Quiz")
root.geometry('500x300')

def Click():  


# let the user know what is going on
label1 = Label(root, text="Please Enter Your Name: ")
label1.grid(row=0, column=1, padx=10, pady=10)

# this your input area
enter1 = Entry(root, width=15, bg='Green')
enter1.grid(row=1, column=1, padx=10)

# the result displays here
label2 = Label(root, text="", width=50)
label2.grid(row=3, column=1, columnspan=1, pady=10)

# put the cursor into the entry field
enter1.focus()

# this is your mouse action button, right-click it to execute command
button1 = Button(root, text=" OK ", command=Click)
button1.grid(row=2, column=1, columnspan=1, padx=10, pady=10)

# the result displays here
label3 = Label(root, text="Please Select Your Option From Below: ", width=50)
label3.grid(row=4, column=1, columnspan=1, pady=10)

#add label
label4 = Label(root)
label4.grid(row=9, column=1)

def Addition1():
    # create the window and give it a title
    root = Tk()
    root.title("Addition 1-100")
    root.geometry('500x300')
    global num1 
    num1 = random.randint(1, 100)
    global num2 
    num2 = random.randint(1, 100)
    global answer 
    answer = num1 + num2
    label4.config(text='What is ' + str(num1) + '+' + str(num2) + '?')

def Addition2():
    # create the window and give it a title
    root = Tk()
    root.title("Addition 1-200")
    root.geometry('500x300')
    global num3 
    num3 = random.randint(1, 200)
    global num4 
    num4 = random.randint(1, 200)
    global answer 
    answer = num3 + num4
    label4.config(text='What is ' + str(num3) + '+' + str(num4) + '?')

def Addition3():
    # create the window and give it a title
    root = Tk()
    root.title("Addition 1-500")
    root.geometry('500x300')
    global num5 
    num5 = random.randint(1, 500)
    global num6 
    num6 = random.randint(1, 500)
    global answer 
    answer = num5 + num6
    label4.config(text='What is ' + str(num5) + '+' + str(num6) + '?')

def Substraction1():
    # create the window and give it a title
    root = Tk()
    root.title("Substraction (1-100)")
    root.geometry('500x300')
    global num7 
    num7 = random.randint(1, 100)
    global num8 
    num8 = random.randint(1, 100)
    global answer 
    answer = num7 - num8
    label4.config(text='What is ' + str(num7) + '-' + str(num8) + '?')

def Substraction2():
    # create the window and give it a title
    root = Tk()
    root.title("Substraction (1-200)")
    root.geometry('500x300')
    global num9 
    num9 = random.randint(1, 200)
    global num10 
    num10 = random.randint(1, 200)
    global answer 
    answer = num9 - num10
    label4.config(text='What is ' + str(num9) + '-' + str(num10) + '?')

def Substraction3():
    # create the window and give it a title
    root = Tk()
    root.title("Substraction (1-500)")
    root.geometry('500x300')
    global num11 
    num11 = random.randint(1, 500)
    global num12 
    num12 = random.randint(1, 500)
    global answer 
    answer = num11 - num12
    label4.config(text='What is ' + str(num11) + '-' + str(num12) + '?')

def Abouttheprogram():
    # create the window and give it a title
    root = Tk()
    root.title("About The Program")
    root.geometry('500x300')

def Abouttheauthor():
    # create the window and give it a title
    root = Tk()
    root.title("About The Author")
    root.geometry('500x300')
    
def Help():
    # create the window and give it a title
    root = Tk()
    root.title("Help")
    root.geometry('500x300')

def Exit():
    raw_input("\nPress enter key to exit. ")

# operation options 1
Add1Button = Button(root, text='Additon\n (1-100)', bg='Green', command=Addition1)
Add1Button.grid(row=5, column=0)

# 2
Add2Button = Button(root, text='Additon\n (1-200)', bg='Green', command=Addition2)
Add2Button.grid(row=5, column=1)

# 3
Add3Button = Button(root, text='Additon\n (1-500)', bg='Green', command=Addition3)
Add3Button.grid(row=5, column=2)

# 4
Sub1Button = Button(root, text='Substraction\n (1-100)', bg='Green', command=Substraction1)
Sub1Button.grid(row=6, column=0)

# 5
Sub2Button = Button(root, text='Substraction\n (1-200)', bg='Green', command=Substraction2)
Sub2Button.grid(row=6, column=1)

# 6
Sub3Button = Button(root, text='Substraction\n (1-500)', bg='Green', command=Substraction3)
Sub3Button.grid(row=6, column=2)

# About The Program Button
ProButton = Button(root, text='About The Program', bg='Green', command=Abouttheprogram)
ProButton.grid(row=8, column=0)

# About The Author Button
AutButton = Button(root, text='About The Author', bg='Green', command=Abouttheauthor)
AutButton.grid(row=9, column=0)

# Help Button
HelpButton = Button(root, text='Help', bg='Green', command=Help)
HelpButton.grid(row=8, column=2)

# Exit Button
ExitButton = Button(root, text='Exit', bg='Green', command=Exit)
ExitButton.grid(row=9, column=2)

# start the mouse/keyboard event loop
root.mainloop()
Reply With Quote  
Join Date: Oct 2004
Location: Mojave Desert
Posts: 2,425
Reputation: vegaseat will become famous soon enough vegaseat will become famous soon enough 
Rep Power: 9
Solved Threads: 173
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
Kickbutt Moderator

Re: Combining two python programs together...HELP!!!

  #9  
Jul 21st, 2008
Recommended style for Python code is capitalized names for class names and non-capitalized names for functions.

Don't let def click(): dangle in space, use at least a ...
def click():
    pass
.. until you fill it in with your code.

Your prograsm can only have one main window or root window. If you want other windows to pop up you have to use child windows ...
  1. # display message in a child window
  2.  
  3. from Tkinter import *
  4.  
  5. def messageWindow(message):
  6. # create child window
  7. win = Toplevel()
  8. # display message
  9. Label(win, text=message).pack()
  10. # quit child window and return to root window
  11. Button(win, text='OK', command=win.destroy).pack()
  12.  
  13. def createMessage():
  14. global counter
  15. counter = counter + 1
  16. message = "This is message number " + str(counter)
  17. messageWindow(message)
  18.  
  19. counter = 0
  20.  
  21. # create root window
  22. root = Tk()
  23. # put a button on it, command executes the given function on button-click
  24. Button(root, text='Bring up Message', command=createMessage).pack()
  25. # start event-loop
  26. root.mainloop()
... or dialog windows like ...
  1. # use Tkinter popup dialogs for input
  2.  
  3. from Tkinter import *
  4. from tkSimpleDialog import askfloat # also askinteger, askstring
  5.  
  6. def get_data():
  7. miles = askfloat('Miles', 'Enter miles driven')
  8. petrol = askfloat('Petrol', 'Enter gallon of petrol consumed')
  9. str1 = "Your milage is %0.2f miles/gallon" % (miles/petrol)
  10. var1.set(str1)
  11.  
  12. root = Tk()
  13. var1 = StringVar()
  14.  
  15. button1 = Button(root, text="Get data", command=get_data).pack(pady=5)
  16. label1 = Label(root, textvariable=var1).pack()
  17.  
  18. root.mainloop()
Looks like you are well on the way of learning the GUI ropes!
Last edited by vegaseat : Jul 21st, 2008 at 10:10 am.
May 'the Google' be with you!
Reply With Quote  
Join Date: Oct 2004
Location: Mojave Desert
Posts: 2,425
Reputation: vegaseat will become famous soon enough vegaseat will become famous soon enough 
Rep Power: 9
Solved Threads: 173
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
Kickbutt Moderator

Re: Combining two python programs together...HELP!!!

  #10  
Jul 21st, 2008
An approach like this would simplify your game, taking advantage of some of the GUI features ...
  1. from Tkinter import *
  2. from tkSimpleDialog import askinteger # also has askfloat, askstring
  3. import random
  4.  
  5. def get_number(title="Integer Entry", prompt="Enter a number: "):
  6. return askinteger(title, prompt)
  7.  
  8. def addition1():
  9. num1 = random.randint(1, 100)
  10. num2 = random.randint(1, 100)
  11. answer = num1 + num2
  12. myprompt = 'What is ' + str(num1) + '+' + str(num2) + '?'
  13. ask_player(answer, myprompt)
  14.  
  15. def addition2():
  16. num1 = random.randint(1, 200)
  17. num2 = random.randint(1, 200)
  18. answer = num1 + num2
  19. myprompt = 'What is ' + str(num1) + '+' + str(num2) + '?'
  20. ask_player(answer, myprompt)
  21.  
  22. def addition3():
  23. num1 = random.randint(1, 500)
  24. num2 = random.randint(1, 500)
  25. answer = num1 + num2
  26. myprompt = 'What is ' + str(num1) + '+' + str(num2) + '?'
  27. ask_player(answer, myprompt)
  28.  
  29. def subtraction1():
  30. num1 = random.randint(1, 100)
  31. num2 = random.randint(1, 100)
  32. answer = num1 - num2
  33. myprompt = 'What is ' + str(num1) + '-' + str(num2) + '?'
  34. ask_player(answer, myprompt)
  35.  
  36. def subtraction2():
  37. num1 = random.randint(1, 200)
  38. num2 = random.randint(1, 200)
  39. answer = num1 - num2
  40. myprompt = 'What is ' + str(num1) + '-' + str(num2) + '?'
  41. ask_player(answer, myprompt)
  42.  
  43. def subtraction3():
  44. num1 = random.randint(1, 500)
  45. num2 = random.randint(1, 500)
  46. answer = num1 - num2
  47. myprompt = 'What is ' + str(num1) + '-' + str(num2) + '?'
  48. ask_player(answer, myprompt)
  49.  
  50. def ask_player(answer, myprompt):
  51. name = enter1.get()
  52. # use a default name if none is given
  53. if not name:
  54. name = "Player"
  55. attempt = 1
  56. while True:
  57. myanswer = get_number(prompt=myprompt)
  58. if myanswer == answer:
  59. label4.config(text=name + ", you are correct!")
  60. break
  61. if attempt >= 3:
  62. label4.config(text=name + ", you used up your 3 attempts!")
  63. break
  64. label4.config(text=str(attempt) + ": Not correct! Try again!")
  65. attempt += 1
  66.  
  67. # create the window and give it a title
  68. # the root window will expand to accomodate all
  69. root = Tk()
  70. root.title("Main Menu - Mathematics Quiz")
  71. root.configure(bg='beige')
  72.  
  73. # ask for the player's name
  74. # Label and Entry
  75. label1 = Label(root, text="Please Enter Your\n Name Below:", bg='beige')
  76. label1.grid(row=0, column=2, pady=5)
  77. enter1 = Entry(root, width=15, bg='green')
  78. enter1.grid(row=1, column=2, pady=5)
  79.  
  80. # create your ops buttons
  81. Add1Button = Button(root, text=' Addition \n (1-100)', bg='green',
  82. width=15, command=addition1)
  83. Add1Button.grid(row=2, column=0, padx=5)
  84.  
  85. Add1Button = Button(root, text=' Addition \n (1-200)', bg='green',
  86. width=15, command=addition2)
  87. Add1Button.grid(row=2, column=1, padx=5)
  88.  
  89. Add1Button = Button(root, text=' Addition \n (1-500)', bg='green',
  90. width=15, command=addition3)
  91. Add1Button.grid(row=2, column=2, padx=5)
  92.  
  93. Sub1Button = Button(root, text=' Subtraction \n (1-100)', bg='green',
  94. width=15, command=subtraction1)
  95. Sub1Button.grid(row=2, column=3, padx=5)
  96.  
  97. Sub2Button = Button(root, text=' Subtraction \n (1-200)', bg='green',
  98. width=15, command=subtraction2)
  99. Sub2Button.grid(row=2, column=4, padx=5)
  100.  
  101. Sub3Button = Button(root, text=' Subtraction \n (1-500)', bg='green',
  102. width=15, command=subtraction3)
  103. Sub3Button.grid(row=2, column=5, padx=5)
  104.  
  105. # create an output label
  106. label4 = Label(root, text='------------', bg='beige')
  107. label4.grid(row=3, column=4, columnspan=2, pady=10)
  108.  
  109. # start the mouse/keyboard event loop
  110. root.mainloop()
Last edited by vegaseat : Jul 21st, 2008 at 11:44 am. Reason: colors
May 'the Google' be with you!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Python Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Python Forum

All times are GMT -4. The time now is 10:32 am.