tkinter

subset dataframe to show on GUI Tkinter

社会主义新天地 提交于 2021-02-11 14:31:14
问题 I have dropdown option in tkinter which select the option of dropdown by groupby the col1 by dataframe pandas , Now I am able to see the subset of dataframe by clicking ok button in my terminal , I want to see the subset dataframe after selecting into dropdown in my GUI , Please let me know how to see the subset dataframe a/c to dropdown option into my GUI . import tkinter as tk import pandas as pd # --- functions --- def on_click(): val = selected.get() if val == 'all': print(df) else: df2 =

fix this code 'cannot use geometry manager grid inside . which already has slaves managed by pack'

坚强是说给别人听的谎言 提交于 2021-02-11 13:49:23
问题 I wrote this simple code using grid(), but there seem to be a problem and shows the error : class Input_screen: def __init__(self,master): frame = Frame(master) frame.pack() self.name_lable = Label(frame,text = 'NAME') self.name_e = Entry(root) self.name_lable.grid(row=1,column=0,sticky=W) self.name_e.grid(row=1,column=1) root = Tk() b = Input_screen(root) root.mainloop() TclError: cannot use geometry manager grid inside . which already has slaves managed by pack 回答1: The error is telling you

Error involving Tkinter/matplotlib “no display name and no $DISPLAY environment variable” on CentOS

ぃ、小莉子 提交于 2021-02-11 13:46:37
问题 Most relevant questions I've seen here are not fixing my issue. I'm writing a program that uses matplotlib and tkinter to make a GUI. I'm running CentOS7. I get this when trying to run python36 testGraph.py on my server: Traceback (most recent call last): File "testGraph.py", line 167, in <module> app = SeaofBTCapp() File "testGraph.py", line 57, in __init__ tk.Tk.__init__(self, *args, **kwargs) File "/usr/lib64/python3.6/tkinter/__init__.py", line 2020, in __init__ self.tk = _tkinter.create

Matplotlib image getting stretched after using “Zoom to rectangle”

坚强是说给别人听的谎言 提交于 2021-02-11 13:37:07
问题 I am using the following code to plot the Matplotlib Basemap on tkinter canvas: from tkinter import * from tkinter.ttk import * import numpy as np from matplotlib.figure import Figure import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import (NavigationToolbar2Tk) from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg as FigureCanvas import os os.environ['PROJ_LIB'] = r'C:\Users\AppData\Local\Continuum\anaconda3\pkgs\proj4-4.9.3-vc14_5\Library\share' from mpl

How can i display a long string (paragraphs) in a label widget on multiple lines with a y scrollbar? (tkinter)

帅比萌擦擦* 提交于 2021-02-11 13:35:39
问题 Hey im trying to put text that contains a few paragraphs in a label widget. I would like it to display on multiple lines and use a y scrollbar so everything can fit and be viewed in the label widget. It should turn out like this: Except instead of a text widget it would be a label widget I have tried to do this with the following code: from tkinter import * writtenSolution = Tk() writtenSolution.title("Written Response Question") writtenSolution.resizable(0,0) header = LabelFrame

How can i display a long string (paragraphs) in a label widget on multiple lines with a y scrollbar? (tkinter)

旧城冷巷雨未停 提交于 2021-02-11 13:34:57
问题 Hey im trying to put text that contains a few paragraphs in a label widget. I would like it to display on multiple lines and use a y scrollbar so everything can fit and be viewed in the label widget. It should turn out like this: Except instead of a text widget it would be a label widget I have tried to do this with the following code: from tkinter import * writtenSolution = Tk() writtenSolution.title("Written Response Question") writtenSolution.resizable(0,0) header = LabelFrame

Tkinter, canvas, create_text and zooming

*爱你&永不变心* 提交于 2021-02-11 13:19:13
问题 Is it normal that Tkinter's Canvas' create_text 's font size doesn't change when I change the Canvas' scale with canvas.scale ? I thought that, as it is a high level GUI management system, I wouldn't have to resize manually the text done with create_text after a zooming. Isn't this strange, or am I wrong ? 回答1: It's normal, even if not entirely what you want. The scale method just changes the coordinate lists, but text items only have one of those so they just get (optionally) translated.

update Flaw in My python tkinter sqlite application

て烟熏妆下的殇ゞ 提交于 2021-02-11 12:50:30
问题 i a beginner and i am trying to make a blood sugar tracking application using python Tkinter and Sqlite, so the problem is that after "selecting" a row from treeview widget and "updating" its values the Blue highlight no longer exists but the data is stored and if the "UPDATE" button/function is clicked again even without selecting a row from treeview the values on the previously selected row get updated. import numpy as np from tkinter import * from tkinter import messagebox from tkinter

update Flaw in My python tkinter sqlite application

荒凉一梦 提交于 2021-02-11 12:50:22
问题 i a beginner and i am trying to make a blood sugar tracking application using python Tkinter and Sqlite, so the problem is that after "selecting" a row from treeview widget and "updating" its values the Blue highlight no longer exists but the data is stored and if the "UPDATE" button/function is clicked again even without selecting a row from treeview the values on the previously selected row get updated. import numpy as np from tkinter import * from tkinter import messagebox from tkinter

python Tkinter tkFileDialog

元气小坏坏 提交于 2021-02-11 12:50:09
问题 in short, what's the difference between tkFileDialog.asksaveasfile and tkFileDialog.asksaveasfilename I could not understand from the build in docs 回答1: asksaveasfile asks the user for a file, then opens that file in write mode and returns it to you so you can write in it. asksaveasfilename asks the user for a file, then returns that file's name. No file is opened; if you want to write to the file, you'll have to open it yourself. asksaveasfilename might be preferred over asksaveasfile if you