Pyqt :If 8+0-5*7/3 is the text entered in the Line Edit widget ,how can we co
Pyqt :If 8+0-5*7/3 is the text entered in the Line Edit widget ,how can we convert it to integer data type ?
[解决办法]
你是想根据 8+0-5*7/3 这个字符串进行计算结果么?
---------------------
C:\Users\ago>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> print eval('8+0-5*7/3')
-3
>>>