我需要访问每个单独类的文本框中的信息)所以我可以使用每个类中的变量进行计算我知道如何在没有 GUI 的情况下进行计算,但使用像 PyQt5 这样的 GUI
>>> a = 'ABC, DEF, GHIJ'
>>> a.split(',')
['ABC', ' DEF', ' GHIJ']
>>> a = a.split(',')
>>> c = '7.00, 8.00, 9.00'
>>> c = c.split(',')
>>> e = '7.20, 8.20, 9.20'
>>> e = e.split(',')
h = {}
class Profile:
def __init__(self, *args):
self.one = h['info1']
self.two = h['info2']
self.three = h['info3']
>>> e = []
>>> for i in range(len(a)): # Takes splitted info above, combines it, and adds it to a dictionary(Ex: h['info1'] = ABC, h['info2'] = 7.00, h['info'] = 7.20)
h['info1'] = a[i]
h['info2'] = c[i]
h['info3'] = e[i]
e.append(Profile(h['info1'], h['info2'], h['info3'])) # Adds each combined list index to its own individual class