Category : tkinter

I have two functions CheckOs and _get_keyfile as below: 1:CheckOs(without considering Mac) def CheckOs(): if os.name == ‘nt’: return "Windows" return "Linux" 2:_get_keyfile def _get_keyfile(stdscr): keyfile = Tk() keyfile.withdraw() if CheckOs() == "Windows": keyfile.KeyfileName = filedialog.askopenfilename(initialdir="/", title="Selecta Key File",filetypes=(("Anfu Keyfiles", "*.anky"),)) #if not windows then linux,IGNOREEEEEEEEE MAC keyfile.KeyfileName = filedialog.askopenfilename(initialdir="/home", title="Select a Key File",filetypes=(("Anfu Keyfiles", ..

Read more

Hi I am trying to add console output to a window created using PySimpleGui , It works Perfectly until I add html test-runner , can anyone suggest a method to use both of them at once import unittest import PySimpleGUI as sg class Sampletestclass(unittest.TestCase): def test_1_State(self): self.assertTrue(2 > 9) print(‘1’) def test_2_State(self): print("2") sg.theme("DarkBlue3") layout ..

Read more

Hi I am trying to add console output to a window created using PySimpleGui , It works Perfectly until I add html test-runner , can anyone suggest a method to use both of them at once import unittest import PySimpleGUI as sg class Sampletestclass(unittest.TestCase): def test_1_State(self): self.assertTrue(2 > 9) print(‘1’) def test_2_State(self): print("2") sg.theme("DarkBlue3") layout ..

Read more

optsv= StringVar() VILLAGE_NA=StringVar() options=[] cursor.execute("SELECT VILLAGE_NA FROM Sheet1") idv =cursor.fetchall() for i in idv: options.append(str(i[0])) def lookupvillage(event): VILLAGE_NA.set(combov.get()) options=combov.get() query="SELECT * FROM Sheet1 WHERE id=%s" cursor.execute(query) rowsv=cursor.fetchall() print(rowsv) Label(wrapper, text="Select Village").grid(row=3, column=0, padx=10, pady=10) combov=ttk.Combobox(wrapper, textvariable=optsv, width=30) combov[‘values’]=options combov.grid(row=3, column=1,padx=50, pady=50) combov.bind("<<ComboboxSelected>>", lookupvillage) lbl4=Label(wrapper2, text="Village") lbl4.grid(row=0, column=6, padx=10, pady=10) ent4=Entry(wrapper2, textvariable=VILLAGE_NA) ent4.grid(row=0, column=7, padx=10, pady=10) ..

Read more