165 Discussion / Question Topics

Remove Filter
Member Avatar for
Member Avatar for davecoventry

I have written the following Tkinter script: When I run it, the first thing that happens is the File Dialog box opens without it being called. I am expecting the file dialog box only to open when the "Open Document" button is pressed. import tkinter as tk from tkinter import …

Member Avatar for davecoventry
0
251
Member Avatar for Ian_7

Hi all, Have my below program: from tkinter import * from tkinter import ttk from tkinter import messagebox class Application(object): def __init__(self, master): self.master = master qPlacement = IntVar() self.cc = ttk.Combobox(self.master, textvariable=qPlacement, width = 5).place(x = 5, y = 30) Button(self.master, text = 'Click Me', command = self.popCombo).place(x = …

0
82
Member Avatar for KarolP

I would like to create a custom theme for my app. I can't get the button widget to expand in my code below. I can configure the button using the minimum width parameter but it should expand to fit the text as specified under layout. Any ideas what is wrong …

0
87
Member Avatar for KarolP

Hi! I am a begineer in programming. I have started to work on the app using tkinter. I would like to add a contact form (similar to Django) to my app so a user can send me a message with queries. This message would be sent to my email address. …

Member Avatar for rproffitt
0
276
Member Avatar for Peter_TARAS

Hello, I am learning Tkinter. As a part of the learning process I am building a Notepad clone in order to become familiar with Tkinter widgets. I am pretty close to completing it - I added about 90% functionality to the application - but I face two problems: 1) The …

Member Avatar for bevis.hobbs
0
22K
Member Avatar for Crazyscript77

Hi all, Ive been looking to convert one of my programs to include a GUI, and am having issues with the timing aspects of it. Ive included a mock scenario of what my problem is below: Ive defined my GUI as an object via a class, and am using the …

Member Avatar for Gribouillis
0
7K
Member Avatar for Maikel

Hi guys, I'm new to Python have get done a lot by searching. Now I try to bind a scroll wheel to canvas, but it doesn't do anything. Will someone look at the code what I do wrong? I tried to keep my snippet clean. Hope It's enough. class Viewer(tk.Toplevel): …

Member Avatar for rproffitt
0
769
Member Avatar for tkpanther

Hello, it is me once more. I am using Python 2.3, and I must use Zelle's graphics class (and I must agree with many of you. Tkinter is much better). We have been tasked with creating a Graphical Scientific Calculator. In addition to the normal operators, it must contain the …

Member Avatar for Gribouillis
0
22K
Member Avatar for steven.rose.94

Fair warning - I'm still learning so this might be a very newb like question: What I'm trying to do: I'm trying to import a python file into a Tkinter window and run it when I press a button. Eventually I'd like to display the output of the imported script …

Member Avatar for steven.rose.94
0
562
Member Avatar for Brandon Hatch

I have no idea how to create a Gui from another Gui using python. What I have so far is simply a basic Gui which you select one of the options from a dropdown menu and create another Gui. Here's what I have so far... import sys from tkinter import …

Member Avatar for Brandon Hatch
0
2K
Member Avatar for DragonMastur

I would like the widgets on the window to expand as you expand the window. I know you can do it with the pack method but I'm using the grid method to arange my widgets. Pack Method: label = Label(root, text="Some Text") label.pack(expand=1, fill=BOTH) Grid Method I'm using: self.inventoryLabel = …

Member Avatar for woooee
0
6K
Member Avatar for Henry_5

I am implementing the last feature of my Python Checkers Game, which is to require the user to make multiple jumps. For captures, I do the following: 1 Check if the move is valid: 2 self.validatedMove = True (The move that has been made is valid.) 3 self.capture() (Captures the …

Member Avatar for DragonMastur
0
788
Member Avatar for vegaseat

This 'sticky' thread is for working examples of Python GUI code. Note that most wxPython examples have their own thread. Please use comments in your code to help the reader. The example code should be usable as a template, so folks get a feel for the toolkit and can use …

Member Avatar for vegaseat
9
45K
Member Avatar for ccandillo

I have a tkinter app that has 2 frames. The frame on the left has a bunch of buttons and the frame on the right has a text widget. I use the create_buttons function below to make the buttons. Is there a way to have the button stay sunken when …

Member Avatar for ccandillo
0
729
Member Avatar for Johnny Blaz

import tkinter from tkinter import ttk top=tkinter.Tk() top.title("Scoreboard") top.configure(background="black") w=ttk.Scrollbar(top,orient='vertical') l1=tkinter.Label(top,height=2,width=67,bd=4,text="Welcome To Cricket World Cup 2015",font=("Purisa",15),fg="white",bg="red",relief="ridge") l1.grid(row=0,column=0,columnspan=67) l2=tkinter.Label(top,height=2,width=25,font=("Purisa",15),text="India",fg="white",bg="red",relief="ridge") l2.grid(row=1,column=0) l3=tkinter.Label(top,height=2,width=15,font=("Purisa",12),text="VS",fg="white",bg="black") l3.grid(row=1,column=1) l4=tkinter.Label(top,height=2,width=25,font=("Purisa",15),text="Australia",fg="white",bg="red",relief="ridge") l4.grid(row=1,column=2) l5=tkinter.Label(top,height=9,width=67,bd=4,font=("Purisa",15),bg="red",relief="ridge") l5.grid(row=3,column=0,columnspan=67) l6=tkinter.Label(top,height=2,width=15,font=("Purisa",12),text="India",fg="white",bg="Black",relief="ridge") l6.grid(row=3,column=0,rowspan=1,sticky="NW") l7=tkinter.Label(top,height=3,width=14,font=("Purisa",20),text="183/2",fg="white",bg="Black",relief="ridge") l7.grid(row=3,column=0) l8=tkinter.Label(top,height=3,width=14,font=("Purisa",20),text="45.1",fg="white",bg="Black",relief="ridge") l8.grid(row=3,column=2) l9=tkinter.Label(top,height=3,width=20,font=("Purisa",12),text="RR = 4.057 ",fg="white",bg="Black",relief="ridge") l9.grid(row=3,column=1,rowspan=1) l10=tkinter.Label(top,height=2,width=15,font=("Purisa",12),text="Toss = Australia",fg="white",bg="Black",relief="ridge") l10.grid(row=3,column=2,rowspan=1,sticky="NE") l11=tkinter.Label(top,height=7,width=67,bd=4,font=("Purisa",15),bg="red",relief="ridge") l11.grid(row=6,column=0,columnspan=67) l12=tkinter.Label(top,height=2,width=13,font=("Purisa",20),text="Player name",fg="white",bg="Black",relief="ridge") l12.grid(row=6,column=0,sticky="NWE") l13=tkinter.Label(top,height=2,width=12,font=("Purisa",20),text="Balls",fg="white",bg="Black",relief="ridge") l13.grid(row=6,column=2,sticky="NEW") l14=tkinter.Label(top,height=2,width=11,font=("Purisa",20),text="Runs",fg="white",bg="Black",relief="ridge") l14.grid(row=6,column=1,sticky="NWE") l15=tkinter.Label(top,height=1,width=10,font=("Purisa",14),text="44",fg="white",bg="Black",relief="ridge") …

Member Avatar for vegaseat
0
4K
Member Avatar for davidbr

Hello, I have this code which is working import Tkinter as tk from Tkinter import * LARGE_FONT= ("Verdana", 12) class ChangePages(tk.Tk): def __init__(self, *args, **kwargs): tk.Tk.__init__(self, *args, **kwargs) container = tk.Frame(self) container.pack() container.grid_rowconfigure(0, weight=1) container.grid_columnconfigure(0, weight=1) self.frames = {} for F in (MainPage, Page01, Page02): frame = F(container, self) self.frames[F] …

Member Avatar for davidbr
0
4K
Member Avatar for biocompute

I have a Tkinter GUI that is composed of two widgets, the first is a widget class with an entry field and a button and the second is a scrollable text widget class. I have combined these two widget classes to make a single GUI. Each of these widget classes …

Member Avatar for vegaseat
0
7K
Member Avatar for Niloofar24

Hello. I have a Class in my python file. That Class contains some functions. How can i set the command of a Tkinter butten so that call a function of that class? I tried this but it didn't work: class calculating(object): def __inint__(self): self.current = 0 def addition(self, amount): self.current …

Member Avatar for HiHe
0
10K
Member Avatar for Niloofar24
Member Avatar for Niloofar24

Hi everybody. I have problem with .pack() and .grid(). I have to use this line: mywin.pack(fill=BOTH, expand=YES) I have used .grid every where on my file but now here i have copied a pice of code from some where and have pasted to my file, as you see it has …

Member Avatar for vegaseat
0
4K
Member Avatar for Niloofar24

Hello. When we want to insert a vlue into a table in sqlite, we use this line, right? cursor.execute('INSERT INTO colors Values ("red", "blue")') As we can see above, we want to insert 2 words and we type them as when we are typing whole the codes. But i want …

Member Avatar for vegaseat
0
5K
Member Avatar for ShilohAmi

Hi, is that possible Tkinter to play a video? And if not possible so what GUI programming that you can recomended? I already search in google, find a few but there's dead link.. I need to show 2 windows, first the original video, and the second is video after processing

Member Avatar for ShilohAmi
0
1K
Member Avatar for Niloofar24

Hello. I have used ScrolledText in my code, the scroll bar that appears is attached to the frame and although it scrolls the text box contents, I want that it was attached to the text widget itself. What can i do?

Member Avatar for HiHe
0
337
Member Avatar for Niloofar24

Hello friends :) I'm almost familiar with Tkinter and Kivy frameworks, but i'm looking for other python GUI frameworks, soething better than Tkinter. Kivy is also great but i need to watch more tutorial videos and i'm not able to do that right now. Can you introduce a better and …

Member Avatar for vegaseat
0
840
Member Avatar for Niloofar24

Hello. How can i set an image as a Tkinter window background? I mean the whole background of the window not a photo area.

Member Avatar for HiHe
0
49K
Member Avatar for Niloofar24

Hi everybody. How can i install ttk module on linux? When i try to import and use it on my Tkinter window, the error says sth like there is no module named ttk. So it means i should install it right?! I'm using python 2. I want to use ttk …

Member Avatar for Gribouillis
0
12K
Member Avatar for Niloofar24

Hi friends! I'm coding a program; i have a Tkinter window with a view button and i can add names with entry box and add button into a list that will be saved on a db file. Now i want the program to show the list names otomaticly when the …

Member Avatar for Niloofar24
0
256
Member Avatar for Niloofar24

Hello! My this time question is about breaking a list. I have a list with the name favorite_movies. Here is 2 functions of all functions from the file: def add(): load_favorite() favorite_movies.append(ent.get()) dump_favorite() #print (colors) def view(): load_favorite() from Tkinter import * v = Tk() v.geometry('300x300') v.configure(background = 'white') top …

Member Avatar for Niloofar24
0
559
Member Avatar for Niloofar24

Hello friends :) This is my code: #!/usr/bin/env python3 # -*-coding: utf8-*- def callback(): lbl.configure(text = 'button clicked!') import Tkinter window = Tkinter.Tk() window.geometry('300x300') window.configure(background = 'PeachPuff3') lbl = Tkinter.Label(window, text = 'Nothing yet!') btn = Tkinter.Button(window, text = 'add', command = callback).pack() window.mainloop() Why it doesn't work?

Member Avatar for Niloofar24
0
10K
Member Avatar for Niloofar24

Hi everybody! How can i call a function from Tkinter without using Buttons? I have a test.py file and there is a function def message in it: def message(): print('Good morning') from Tkinter import * tk = Tk() tk.mainloop() I want to type test.py message from linux terminal and the …

Member Avatar for sneekula
0
11K

The End.