Python Forum
Help adding memory buttons/commands in the calculator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help adding memory buttons/commands in the calculator
#3
(Mar-04-2021, 04:24 PM)deanhystad Wrote: What should they do? memo suggests that there is a place to take a memo, some kind of storage location. What do you want to happen when memo_add() is called?

Dean, there are three buttons:
MS: save number to memory
M+: sum the memory saved number to the number on the screen
M-: subtract the memory saved number from the number on the screen
Like a real calculator.

#### Buttons I don't know how to make it work
Button(width=4, text='Ms', relief='flat', command=self.memo_add).place(x=360, y=50) # must save to memory
Button(width=4, text='M+', relief='flat', command=self.memo_sum).place(x=360, y=90) # must sum to the screen value
Button(width=4, text='M-', relief='flat', command=self.memo_sub).place(x=360, y=130) # must subtract from the screen value

#### COMMANDS I NEED HELP WITH
def memo_add(self): # must save number to memory
def memo_sum(self): # must sum the saved number to the screen value
def memo_sub(self): # must subtract from the screen value
Reply


Messages In This Thread
RE: Help adding three buttons/commands in the calculator - by joelpub - Mar-04-2021, 04:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Made a discord bot game that uses commands but now trying to add buttons Dmcsdiscord 1 230 Apr-22-2024, 02:27 PM
Last Post: Dmcsdiscord
  Adding markers to Folium map only adding last element. tantony 0 2,143 Oct-16-2019, 03:28 PM
Last Post: tantony
  AttributeError: 'Calculator' object has no attribute 'buttons' Gomez2021 5 6,338 Apr-18-2018, 01:34 AM
Last Post: IAMK
  Buttons or Radio Buttons on Tkinter Treeview draems 0 3,406 Oct-31-2017, 04:06 AM
Last Post: draems

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020