Math?
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
19 Jun 2015 18:24 - 19 Jun 2015 18:58 #59985
by Todd Zuercher
Math? was created by Todd Zuercher
Is it possible to create a spinbutton where you can do some basic math (add, subtract, multiply, divide)? Such as say the box currently has a value of 6.500, I would like to be able to move the cursor to the end of the number, type +1.125, press enter and have the value of the box change to 7.625. Another example would be inputting fractional measurements such as 10+11/16, press enter and the value would show 10.6875.
Last edit: 19 Jun 2015 18:58 by Todd Zuercher.
Please Log in or Create an account to join the conversation.
19 Jun 2015 18:59 #59988
by mhaberler
no it would not: lmgtfy.com/?q=python+eval+math+expression
That would require a math parser behind it = a lot of code.
no it would not: lmgtfy.com/?q=python+eval+math+expression
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
19 Jun 2015 21:22 #59992
by Todd Zuercher
Thanks John,
Looking forward to seeing an example.
Replied by Todd Zuercher on topic Math?
Yes, you can do that in the Python handler. I think Andy has done that on one of his GUI's. I've done it in Python. IIRC you use the activate signal to call your handler. I'll see if I can find an example.
JT
Thanks John,
Looking forward to seeing an example.
Please Log in or Create an account to join the conversation.
Moderators: HansU
Time to create page: 0.080 seconds