我必须运行代码的以下部分,其中Unicode被一个Unicode除以。
def updateUI(self):
p = unicode(self.SpinB1.value())
r = unicode(self.SpinB2.value())
t = unicode(self.Combo1.currentText())
t = t.split()
q = t[0]
amount = p * ((1 + (r / unicode(100)))**q)
self.label5.setText(amount)我得到以下错误:'TypeError: /的不支持的操作数类型:'unicode‘和’unicode‘
我该怎么做才能让这件事起作用?
发布于 2014-07-05 11:56:35
不能划分unicode类型。转换为ints或浮动,然后再分割:
amount = int(p) * ((1 + (int(r) / 100))**int(q))https://stackoverflow.com/questions/24586105
复制相似问题