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()
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)
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()