Пример #1
0
    def selectFile(self):
        self.filePath = askopenfilename()
        if len(self.filePath) != 0:
            with open(self.filePath, 'r') as f:
                self.Graph = [[int(num) for num in line.split(',')]
                              for line in f]

            self.numberOfVertices = DS.CountVertices(self.Graph)
            if self.numberOfVertices != 0:
                self.fileSelectionLabel.configure(
                    text="Graph extracted with {} vertices".format(
                        self.numberOfVertices))
            else:
                self.fileSelectionLabel.configure(text="Input Not accepted")