import csv
from tkinter import messagebox
from PyQt5.uic import loadUi
from PyQt5.QtWidgets import QTreeWidgetItem,QTreeWidget,QApplication,QWidget,QPushButton,QFileDialog,QLineEdit
class Node:
def __init__(self,num,name,score_1,score_2,score_3):
self.num=num
self.name=name
self.score=[score_1,score_2,score_3]
if self.num is not None:
self.score.append(score_1+score_2+score_3)
self.next=None
class linklist:
def __init__(self):
self.head=Node(None,None,None,None,None)
def isempty(self):
if self.head.next==None:
return True
else:
return False
def insert(self,num,name,score_1,score_2,score_3):
new_node=Node(num,name,score_1,score_2,score_3)
if self.isempty():
self.head.next=new_node
else:
new_node.next=self.head.next
self.head.next=new_node
def sort_score(self,i):
i=i-2
p=self.head.next
while p:
q=p.next
while q:
if i>=0:
if q.score[i]>p.score[i]:
q.num,q.name,q.score,p.num,p.name,p.score=p.num,p.name,p.score,q.num,q.name,q.score
elif i==-1:
if q.name[0]