Python Forum
Scientific Calculator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scientific Calculator
#6
(Dec-04-2019, 09:08 PM)Spacecowboy Wrote: ##UPDATE##

@ line 47 changed to : added_value = Rekenmachine

There is now an error
   
btn[i] ["command"] = lambda x= numberpad[i]: added_value.numberEnter(x)
TypeError: numberEnter() missing 1 required positional argument: 'num'

@Clunk_Head the assignment before was a simple calculator without class
try
btn[i] ["command"] = lambda: added_value.numberEnter(numberpad[i])
but if you don't need a class in the program then you can simplify your code quite a bit by removing it, turning the instance variables into global variables, and defining the functions independent of a class.
Reply


Messages In This Thread
Scientific Calculator - by Spacecowboy - Dec-04-2019, 07:40 PM
RE: Scientific Calculator - by Clunk_Head - Dec-04-2019, 08:16 PM
RE: Scientific Calculator - by Spacecowboy - Dec-04-2019, 08:44 PM
RE: Scientific Calculator - by Clunk_Head - Dec-04-2019, 09:05 PM
RE: Scientific Calculator - by Spacecowboy - Dec-04-2019, 09:08 PM
RE: Scientific Calculator - by Clunk_Head - Dec-04-2019, 09:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  i need help in fixing my scientific calculator coding : (, im using python 3.5.5 hans77 1 4,191 Oct-17-2018, 03:26 AM
Last Post: stullis
  scientific numbers metalray 1 2,477 Feb-06-2018, 06:50 PM
Last Post: boring_accountant

Forum Jump:

User Panel Messages

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