示例#1
0
文件: graphics.py 项目: fargelus/SAPR
    def __init__(self):
        con = lite.connect('/home/dima/Рабочий стол/САПР/Computer Mechanic/data/res.db')
        with con:
            cur = con.cursor()
            self.data = tuple(cur.execute('SELECT * FROM Ux'))

        filename = open('/home/dima/Рабочий стол/САПР/Computer Mechanic/data/filepath.txt').readline().strip()
        self.nodes = get_data(filename)[1]
        self.draw()
示例#2
0
    def open_file(self):
        filename = askopenfilename(parent=self, defaultextension='.db', filetypes=[('Database', '.db'),
                                                                                   ('SQLite3', '.sqlite3'),
                                                                                   ('SQLite', '.sqlite')],
                                   initialdir='/home/dima/Рабочий стол/САПР/Computer Mechanic/data')

        save_filename = open('/home/dima/Рабочий стол/САПР/Computer Mechanic/data/filepath.txt', 'w')
        save_filename.write(filename)

        rods, nodes = get_data(filename)

        Rodstable.fill_dict(rods)
        Nodestable.set_dict(nodes)
示例#3
0
文件: graphics.py 项目: fargelus/SAPR
    def __init__(self, parent=None):
        General.__init__(self, parent)
        self.pack()

        self.master.title('График Nx')

        con = lite.connect('/home/dima/Рабочий стол/САПР/Computer Mechanic/data/res.db')
        with con:
            cur = con.cursor()
            self.data = tuple(cur.execute('SELECT * FROM Nx'))

        filename = open('/home/dima/Рабочий стол/САПР/Computer Mechanic/data/filepath.txt').readline().strip()
        self.rods = get_data(filename)[0]

        self.draw()