tkinter

making multiple menu's in tkinter

旧城冷巷雨未停 提交于 2021-02-11 18:11:18
问题 Tried searching for this and could not find a suitable answer. I know we can do the following to create a menu to the root window in tkinter menu = Menu(root) some_menu = Menu(menu, ....) some_menu.add_command(label = some text, command = some command) .... menu.add_cascade(label = some title, menu = some_menu) root.config(menu = menu) now let's say that we passed some_menu to the root config instead then it would display the cascade menu's options / children horizontally across the top bar

making multiple menu's in tkinter

天大地大妈咪最大 提交于 2021-02-11 18:08:23
问题 Tried searching for this and could not find a suitable answer. I know we can do the following to create a menu to the root window in tkinter menu = Menu(root) some_menu = Menu(menu, ....) some_menu.add_command(label = some text, command = some command) .... menu.add_cascade(label = some title, menu = some_menu) root.config(menu = menu) now let's say that we passed some_menu to the root config instead then it would display the cascade menu's options / children horizontally across the top bar

making multiple menu's in tkinter

馋奶兔 提交于 2021-02-11 18:07:27
问题 Tried searching for this and could not find a suitable answer. I know we can do the following to create a menu to the root window in tkinter menu = Menu(root) some_menu = Menu(menu, ....) some_menu.add_command(label = some text, command = some command) .... menu.add_cascade(label = some title, menu = some_menu) root.config(menu = menu) now let's say that we passed some_menu to the root config instead then it would display the cascade menu's options / children horizontally across the top bar

making multiple menu's in tkinter

ⅰ亾dé卋堺 提交于 2021-02-11 18:06:28
问题 Tried searching for this and could not find a suitable answer. I know we can do the following to create a menu to the root window in tkinter menu = Menu(root) some_menu = Menu(menu, ....) some_menu.add_command(label = some text, command = some command) .... menu.add_cascade(label = some title, menu = some_menu) root.config(menu = menu) now let's say that we passed some_menu to the root config instead then it would display the cascade menu's options / children horizontally across the top bar

Tkinter python 3.7 AttributeError: 'Button' object has no attribute 'get'

若如初见. 提交于 2021-02-11 17:01:23
问题 I'm writing an inventory database program. I'm a novice so I'm sure I have something wrong. def select_item(): #Create a Database or Connect to one conn = sqlite3.connect('inventory.db') #Create Cursor c = conn.cursor() a = id_select.get() c.execute("SELECT * FROM inventory WHERE oid = " + a) records = c.fetchall() for record in records: Item_editor.insert(0, record[0]) Quantity_editor.insert(0, record[1]) Asset_tag_editor.insert(0, record[2]) Notes_editor.insert(0, record[3]) #Entry Fields

Python save as/open

。_饼干妹妹 提交于 2021-02-11 15:44:10
问题 hello there i am making a text editor in Tkinter (python) and so i made a menu and wanted to know how i can call a function that will display the windows Save-as or open boxes that every program uses. For example in notepad you can click file-save and then it opens the windows save box. I already have the menu but how can i open the save box. Thanks a lot. 回答1: Here is an example from http://www.daniweb.com/forums/thread39327.html: import tkFileDialog def open_it(): filename = tkFileDialog

Building a spider-chart with turtle or tkinter

♀尐吖头ヾ 提交于 2021-02-11 15:13:46
问题 I recently did 2 beginner courses in python coding at university for my Minor, which were followed by an intro to databases and a basic course about CRUD development in PHP. The python course was decent enough and touched on most of the basics. I've been trying to teach myself by making small applications to do things that I have to do for my remaining courses in linguistics. Now I wanted to write a small python application and that takes user input to create a Language profile for that

How to implement tkinter scrollbars?

让人想犯罪 __ 提交于 2021-02-11 14:46:21
问题 I'm struggling with my code to implement horizontal and vertical scrollbars to display the values of a dataframe. I have two frames/canvas, the first for the headers, the second for the values. So far, my code displays the dataframe but I can't finalize the scrollbars properly. Also, I would like my horizontal scrollbar to effect both canevas, so that my values and headers scroll together. But obviously the headers must not scroll with the vertical scrollbar (headers shall always remain

Dynamically updating plot (Funcanimation) in matplotlib

人盡茶涼 提交于 2021-02-11 14:44:13
问题 I am trying to do a dynamically updating plot in Matplotlib Python 3.x using Tkinter. It starts with displaying a file dialog for the user to select the .csv file. Here's the example of the .csv file: I want to plot each row then the plot is updated & plotting the next row. Here's what I currently have: plt.style.use('fivethirtyeight') xs =[] ys = [] csvFile = filedialog.askopenfile(mode='r', filetypes=(("CSV file", "*.csv"), ("All files", "*.*")), title="Select a CSV file") csvFile2 = pd

_tkinter.TclError: invalid command name “.!label4”

时光怂恿深爱的人放手 提交于 2021-02-11 14:41:23
问题 When I run this and enter the testuser credentials, it all works perfectly and produces this window with the green coloured text on the login status widget. However, when I then remove the credentials and type in a random password so that I get the error message, it is not red and produces this error stack (same thing happens if i try to reenter the correct credentials) Exception in Tkinter callback Traceback (most recent call last): File "C:\Program Files\Python38\lib\tkinter\__init__.py",