Python Forum
Pyodbc does not accept variable from tkinter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pyodbc does not accept variable from tkinter
#10
you need to use prefix tk
def Option_SelectionEvent(event):
    print("do it")
 
optionList = ("Server1","Server2","Server3")
    s = tk.StringVar()
    s.set("a")
    self.om = tk.OptionMenu(master, s, *optionList, command=Option_SelectionEvent)
it all depends on how you import the package
when you write:
import tkinter as tk
your saying import package tkinter, and for my program name tkinter tk
so therefore anywhere tkinter would normally be needed, you use tk instead.

if you import thusly:
from tkinter import *
no prefix is needed, so:
s = StringVar()
works.
Reply


Messages In This Thread
RE: Pyodbc does not accept variable from tkinter - by Larz60+ - Feb-12-2019, 05:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  501 Server cannot accept argument anna17 0 189 Apr-11-2024, 01:08 AM
Last Post: anna17
  How to accept facebook cookies using python selenium? pablo86ad 0 197 Apr-06-2024, 09:19 PM
Last Post: pablo86ad
  Using pyodbc&pandas to load a Table data to df tester_V 3 821 Sep-09-2023, 08:55 PM
Last Post: tester_V
  accept command line argument mg24 5 1,312 Sep-27-2022, 05:58 PM
Last Post: snippsat
  pyodbc gmerritt 8 2,911 Feb-21-2022, 07:21 PM
Last Post: gmerritt
  Formatting Data/Time with Pyodbc and openpyxl bearcats6001 0 2,288 Aug-17-2020, 03:44 PM
Last Post: bearcats6001
  Get database used data space from pyodbc susja 1 2,247 Aug-14-2020, 02:01 PM
Last Post: susja
  I need my compiled Python Mac app to accept a file as a parameter Oethen 2 2,421 May-10-2020, 05:57 PM
Last Post: Oethen
  pyodbc error ('82', '[82] 523 80 (0) (SQLDriverConnect)') paulsuk1982 1 2,171 Nov-29-2019, 11:05 AM
Last Post: Larz60+
  pyodbc.Error SQLBindParameter pcarra 0 3,907 Jul-08-2019, 08:22 PM
Last Post: pcarra

Forum Jump:

User Panel Messages

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