# user_list = ['qing58c9,abc123456', 'uffqqcq2,584520']
for row, row_data in enumerate(user_list):
print(row_data) # qing58c9,abc123456 print(row) # 行数 self.user_table.insertRow(row) # 设置有几行 insertRow(行) for column in range(len(user_list) + 1): # 循环遍历每列对象 # 插入内容 setItem(行,列,内容) self.user_table.setItem(row,0,QtWidgets.QTableWidgetItem(row_data.split(",")[0])) # 第一列 self.user_table.setItem(row,1,QtWidgets.QTableWidgetItem(row_data.split(",")[1])) # 第二列