Python Forum
Help Using combobox in a select statement variable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Using combobox in a select statement variable
#3
Essentially yes.

I'm not sure if I can assign the get to a variable and then have a button event to execute the command.

example: variable = "SELECT DB.ID from DB WHERE DB.NAME = "comboboxvalue"

install_command = subprocess.Popen("cmd.exe /c setup.exe variable")

button event button1 = Button(root, text="Install", command=install_command)

I hope that helps to see where I'm wanting to go with it. I still have a lot to work out syntax and logic wise I just wanted to get some help getting started.

from tkinter import *
from tkinter.ttk import *
import mysql.connector


root = Tk()
root.title('Software Installation')
root.geometry("400x400")

conn = mysql.connector.connect(host="x.x.x.x",
                               user="UN",
                               passwd="1234",
                               database="myDb")

c = conn.cursor()

query = "Select DB.NAME from DB Where DB.ENABLED = True"


c.execute(query)
rows=c.fetchall()
# Create Combobox
combo = Combobox(root,values=rows)
combo.pack()



button1 = Button(root, text="Install")
button1.pack()

root.mainloop()
Reply


Messages In This Thread
RE: Help Using combobox in a select statement variable - by cibb - Jun-09-2020, 05:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] How can I sync Combobox index to other combobox index? nickzsche 2 2,456 Jan-03-2022, 12:29 PM
Last Post: Axel_Erfurt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020