How can i make a pyhton calculator that launches on click?
Thank You.

  • What is your OS?
  • Do you want a GUI calculator or would you be content to launch a window in which a line by line calculator runs?
  • Have you looked for solved threads at DaniWeb? Near the top right corner of the page Type Python Calculator in the SEARCH box
  • Have you tried Google?

And where is his code..... What has he done so far?

1)windows 7
2)no GUI interface needed, just a launch window
3)now i will, thanks
4)yep, no help though!

  • What is your OS?
  • Do you want a GUI calculator or would you be content to launch a window in which a line by line calculator runs?
  • Have you looked for solved threads at DaniWeb? Near the top right corner of the page Type Python Calculator in the SEARCH box
  • Have you tried Google?

You can design rather simple calculator using the Python function eval():

# simple calculator using Python function eval()
# improvements:  
# safeguard eval(), error check math expression
# loop for more calculations and so on
#
# importing math functions allows you to enter sin(1.6), pi  etc.

from math import *

# for Python3 use input()
exp = raw_input("Enter math expression (eg. 12*12-4): ")
print(eval(exp))
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.