Code removes the database with passwords, etc. Chrome browser? copies it along the way

C:\ProgramData\Proekt_Data\Chrome_Data

and then opens a table of values.

It is required to get into a separate variable content of the cell by clicking on it with the mouse.

 from tkinter import * from tkinter import ttk import sqlite3 import getpass import shutil import os def chrome_show(*event): root = Tk() root.minsize(width=1040, height=700) root.resizable(width=1920, height=1080) if not os.path.exists("C:\ProgramData\Proekt_Data\Chrome_Data"): shutil.copyfile(r'C:/Users/' + str(getpass.getuser()) + "/AppData/Local/Google/Chrome/User Data/Default/Login data", r"C:\ProgramData\Proekt_Data\Chrome_Data") path_for_sql = "C:\ProgramData\Proekt_Data\Chrome_Data" print(path_for_sql) con = sqlite3.connect(path_for_sql) cur = con.cursor() r = cur.execute('select origin_url,username_value,password_value from logins') tree = ttk.Treeview(root,selectmode='browse') vsby = ttk.Scrollbar(root, orient="vertical", command=tree.yview) vsby.place(x=1020, y=5, height=190+20) tree.configure(yscrollcommand=vsby.set) tree["columns"] = ("1", "2","3") tree['show'] = 'headings' tree.column("1", width=320, anchor='c',stretch = YES) tree.column("2", width=120, anchor='c',stretch = YES) tree.column("3", width=560, anchor='c',stretch = YES) tree.heading("1", text="origin_url") tree.heading("2", text="username_value") tree.heading("3", text="password_value") tree.place(x = 10, y = 10) for c in r: tree.insert('',END,values = c) con.commit() con.close() root.mainloop() root2 = Tk() root2.title("Show password") root2.geometry('400x400') chrome_password_btn = Button(root2,text="Chrome", width=20,height=3, command=chrome_show, activebackground='#FF4500') chrome_password_btn.place (x = 10, y = 10) 

I did not understand get_children() , so I ask for help.

  • get_children() gives a list of the children of the specified node if you have a tree. If the table is, then to get the values ​​of the table row, you need to use the .item(id, option="values") method .item(id, option="values") . - insolor

0