4
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by bumsfeld
0
  • 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?
0

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?
0

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))
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.