199 Topics

Member Avatar for
Member Avatar for WILLIAM_5

Hi everyone, I recently installed Python on Windows. I wanted to develop a gui program using Tkinter. The problem is that when I try to import Tkinter module. It gives me a 'module not found' error. But I thought Tkinter was preintalled within Python's installation. It is even more confusing …

Member Avatar for nichom
1
620
Member Avatar for tunisia

Trying use radio buttons to select which host I'm referring to since ultimately there will only be two and they are fixed addresses. This is the error: File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1410, in call return self.func(*args) File "Untitled 2.py", line 63, in command=lambda: callback_power_off(off, host)) File "Untitled 2.py", line 28, in …

Member Avatar for woooee
0
364
Member Avatar for CodingCabbage

How would I be able to have a button that's command is to return it's text in the button to a variable

Member Avatar for vegaseat
0
968
Member Avatar for CodingCabbage

Why is this not working, no errors? photo exists in correct position... gui doesnt alwyas show up, image doesnt. Using python 3 from tkinter import * from random import * import time mainGUI = Tk() width2= 319 height2 = 240 widthOfScreen = mainGUI.winfo_screenwidth() #Get the width of the screen heightOfScreen …

Member Avatar for vegaseat
0
364
Member Avatar for CodingCabbage

I used code originally by vegaseat what's wrong with code ** error : Traceback (most recent call last): File "C:/Users/Cameron/Computing Work/Year 13/F454 - Computing Project/Design/newthingnewthing.py", line 68, in <module> canvas.create_rectangle(x0, y0, x1, y1, fill="purple") AttributeError: 'NoneType' object has no attribute 'create_rectangle'** _______________________________________________ code: from tkinter import * data = [10, …

Member Avatar for CodingCabbage
0
3K
Member Avatar for vegaseat

Shows you how to create multiple Tkinter buttons in a loop, each with its own name, label and command response.

Member Avatar for CodingCabbage
2
1K
Member Avatar for vegaseat

The code sample shows how to get an image from the internet and show it in a Tkinter label widget.

Member Avatar for Nils_1
4
2K
Member Avatar for CodingCabbage

I'm programming a UI mock-up and need to make the window of fixed size and position. The lines of code for setting the size are as follows : widthOfScreen = mainGUI.winfo_screenwidth() #Get the width of the screen heightOfScreen = mainGUI.winfo_screenheight() #Get the height of the screen mainGUI.geometry("%dx%d+0+0" % (widthOfScreen, heightOfScreen)) …

0
93
Member Avatar for Alexander_2

I am creating a basic hangman game using tkinter. The last thing that I need to do is to add a widget that has an image to show the actual hangman. However, I keep getting this error whenever I try anything: File "C:\Program Files (x86)\Python\lib\tkinter\__init__.py", line 3287, in __init__ Image.__init__(self, …

Member Avatar for vegaseat
0
8K
Member Avatar for pygeek

Hi, im new to this forum, im trying to make a text editor in python for my school, and its nearly finished, but whenever i save a text file then open it again it makes weird square symbols at the end of each line. Thanks in advance. And i didn't …

Member Avatar for pygeek
0
472
Member Avatar for Spider_14
Member Avatar for Joseph Vann

Hello, I am working on a Tk program that generates geometric patterns, and I have written into all of my defs that if the variable "outline" is True it will draw a black outline, otherwise it will draw an outline the same as the fill. I tried a function called …

Member Avatar for ZZucker
0
396
Member Avatar for Ismatus3

Hello , I am making tries to display images in different tkinter windows , in every window displaying a different image , for this i made this code : # -*- coding: cp1252 -*- from Tkinter import * import Tkinter as tk import ttk from PIL import ImageTk, Image import …

Member Avatar for Ismatus3
0
5K
Member Avatar for dreking6

newbie question, but please i need help i just started learning gui programming on python, been getting this error on a code am writing concerning uising the get() method to read an integer from my entry box from Tkinter import * root=Tk() var=StringVar() label=Label(root, textvariable=var, relief=RAISED) var.set("converter") label.pack() L1=Label(text="x:") L1.pack(side= …

Member Avatar for dreking6
0
2K
Member Avatar for Tyyppi_77

So, I'm coding a IDE in Python and I'm using Tkinter for the GUI. What I'm looking for is a way to add a "recent files" menu to the menu that opens when you right click the program's icon in Windows's task bar. I have a picture to show what …

Member Avatar for Tyyppi_77
0
946
Member Avatar for srinivas.rambha

import serial import threading import Queue import Tkinter as tk class SerialThread(threading.Thread): def __init__(self, queue): threading.Thread.__init__(self) self.queue = queue def run(self): s = serial.Serial('COM10',9600) while True: if s.inWaiting(): text = s.readline(s.inWaiting()) self.queue.put(text) class App(tk.Tk): def __init__(self): tk.Tk.__init__(self) self.geometry("1360x750") frameLabel = tk.Frame(self, padx=40, pady =40) self.text = tk.Text(frameLabel, wrap='word', font='TimesNewRoman 37', …

Member Avatar for m_ishwar
0
1K
Member Avatar for Matigo

Hello everyone I'm building my first app using Python TkInter and i would like to have someone help me with this I want to make a checkbox by default it should be False (Unchecked) And make it do something like (Sorry i only know how to do it on visual …

0
95
Member Avatar for m_ishwar

Hello Guys I am trying to make a game with Tkinter. It involves selecting different options from a set of buttons. I created a root for the window, and am done with all the basic game programming. Its a football league simulator allowing players to select a team and choose …

Member Avatar for Schol-R-LEA
0
218
Member Avatar for nexy

How could I pass value entered by user, using tkinter’s Entry to another object? I manage to print it, but couldn’t sent it further… Here are parts of the code: def novo_vreme(): vreme1 = Vreme() root1 = Toplevel(root) root1.title("Vreme") naziv = "Vreme" L1 = Label(root1, text="Zadržavanje: ") L1.place(x=10, y=30) E1 …

Member Avatar for nexy
0
3K
Member Avatar for entropic3105

I have been working with numbers in tkinter using operators but I'm unsure on how to process the input and using maths on them. I also wouldn't mind knowing how to use words either for future reference. Reply if you know anything.

Member Avatar for bumsfeld
0
314
Member Avatar for vegaseat

Simple code to show you how to display an image from a Web URL using the Tkinter Python GUI toolkit, the Python Image Library (PIL) and the data_stream created with io.BytesIO().

Member Avatar for vegaseat
3
4K
Member Avatar for vegaseat

This Python snippet shows how to control a VPython visual 3D sphere with Tkinter GUI toolkit button clicks.

4
3K
Member Avatar for vegaseat

A short code to show you how you can download and display an image from the internet on Python's Tkinter GUI toolkit.

3
308
Member Avatar for woooee

The problem is explained by the comments in the code. It is a fundamental question about the method call...every time I try text_box_name.tk_textBackspace() I get the TclError message. That's why I asked the question without the code... # When user enters a search word in the +search_box' text widget and …

Member Avatar for woooee
0
284
Member Avatar for vegaseat

A closer look at the Tkinter GUI toolkit Toplevel Window and how to lift and lower it respective to other windows.

0
6K
Member Avatar for Lardmeister

This little experiment with Tkinter and pixel drawing shows some strange effects (look at line 27 comments!!!): '''tk_put_pixel.py place a pixel at pos=(x,y) with color=(r,g,b) on an image area note: one pixel might be hard to see, so create a series of pixels (line) ''' try: # Python2 import Tkinter …

0
135
Member Avatar for Twist43

Hi I am struggling with the Tkinter (ttk) Treeview. I want to allow the user to select multiple items in the Treeview using Shift and clicking. However I then want to be able to right click on the selection, or drag the selection using the normal left mouse button (B1). …

0
73
Member Avatar for Twist43

Hi I am busy building a small Python app in which I have two tkinter (ttk) Treeview widgets. I want to be able to drag an item (or multiple selected items) from the one treeview to the other, having the dragged items added to the treeview where they are dropped. …

0
142
Member Avatar for smile1

I apologise in advance but I have resorted to posting all of my code as I'm really struggling on this! I have created a table which is initially empty then a user imports a text file and creates 'n' rows depending on the content. Each row has an option menu …

Member Avatar for TrustyTony
0
1K
Member Avatar for smile1

I have the following code where I have several small problems. I have included some comments as I can't seem to get my 'pop up menu' button to work in order to retrieve the number of columns requested by the user. I then need to be able to get the …

Member Avatar for woooee
0
2K

The End.