2
votes
0answers
18 views

When importing tkinter's “messagebox” module, does the “import tkinter.messagebox” syntax not work?

Since the "messagebox" is a module in the "tkinter" package, why do I have to use from tkinter import messagebox instead of import tkinter.messagebox I was under the impression that to import ...
0
votes
2answers
49 views

Using two counters in a loop

I have been making a text based game at home using Python and have been having trouble with creating a small section of combat between the player and a foe. The combat is supposed to include two ...
1
vote
3answers
49 views

Triangle with points on perimeter of circle, python

I have to make a triangle with 3 random points on perimeter of a circle, that has random center coordinates x and y (random_x and random_y in the code). It takes radius as an input from user. And the ...
1
vote
1answer
14 views

Is there a tkinter equivalent for Perl/Tk's Scrolled pseudo-widget?

Perl/Tk has a pseudo-widget Tk::Scrolled that takes as its argument another widget and adds a corresponding scrollbar according to options (where to put it in relation to the widget and if to show at ...
-4
votes
0answers
30 views

Python Class structure [on hold]

import sys from tkinter import* #Functions to handle button click class App(object): def __init__(self): self.master = Tk() def startgame(): player21abel=Label(self.master, ...
-4
votes
2answers
34 views

Python - How to get string in a Function?

I am currently writing a hang man game. Using Tkinter for GUI. How can I get a string from a function: def startgame(): player21abel=Label(text=" Guess a Letter ...
0
votes
3answers
26 views

Python: Listbox without border

I want to get a table, but when I realized, that there's no table in python, I decided to fix it with two listboxes. The point is, that I don't want a border between them. So my Question is: How to ...
0
votes
1answer
27 views

Invalid command name while executing (“after” script)

As solve this problem? I'm running this code, window is created, but in console appears message on the error. I think problem the fact that is "after" loop not terminate but the window already ...
0
votes
1answer
24 views

Multithreading with Tkinter

I'm having some issues with a Tkinter-based GUI. Basically the GUI creates lots of threads and run them. When each thread has finished, I'd like it to update a label to inform the user of this ...
2
votes
1answer
15 views

tkinter mac, minimize screen

I'm using tkinter in python for mac. Simply put, I want to override the "minimize" button's functionality. I'm already overriding the "X" button functionality in this fashion: root = Tk() ...
0
votes
1answer
55 views

Python: initializing method in class

I created a simple program that displays 28 numbers on the screen. Currently, nothing happens when you click on the numbers. Eventually, I want the numbers to disappear on click. Also, when you click ...
0
votes
1answer
17 views

Python Tkinter: create a menu button on the right side

I am able to create a window with a menu and its sub-menus. However, I would like to create a single MenuButton on the right side. How do I do that? menubar = Menu(self.parent) ...
0
votes
1answer
26 views

call function after certain time and kill on button press, tkinter

I have made an entry widget and it gets the number entered when they click OK (this becomes the number of seconds for function to recur(n)), I want to call the function every n seconds. When OK is ...
0
votes
0answers
16 views

tkinter and mayavi conflict - anaconda on OS X

I just recently started working with mayavi, and in order to get that library built and functional I ultimately turned to anacoda which made getting it working insanely easy. I was originally working ...
0
votes
1answer
37 views

Tkinter calculator, can only do 1 operation

import tkinter import tkinter.messagebox import sys top=tkinter.Tk() from tkinter import* def clear(): e1.delete(0,END) return def seven(): v.set(v.get()+str("7")) v.get() def ...
0
votes
2answers
23 views

How can I get my animation loop working?

I have been trying to implement an animation loop to work around the slight delay I was getting when moving a canvas item after hitting an arrow key but am now stuck. My code is shown below and I ...
0
votes
1answer
20 views

multi line Tkinter button?

i have the following button: option1=tkinter.Button(opt1,text='this is a test to see how many words we can fit in a button and stuff so heres some more words',width=49,height=3,bg='grey',) this ...
0
votes
1answer
7 views

Creating a global canvas in Tkinter Python

I am doing a simple game as a school assignment but I have problems updating my canvas. I've tried some loops and sleep commands but they don't seem to work. Now I have code that should refresh the ...
0
votes
1answer
38 views

How can I achieve SMOOTH movement of canvas item in Tkinter?

I am trying to play around with keyboard driven events in Tkinter so that I can move an object around a canvas widget. Up, Down, Left and Right work OK but when I try to program two keys together the ...
0
votes
0answers
18 views

How to use winfo_width() (Tkinter) [duplicate]

There are lot answer on stackoverflow that say "to width of the widget one shoud use winfo_width()". e.g. Get Tkinter Window Size Could anybody point me to what I'm doing wrong? My example code: ...
0
votes
1answer
35 views

Python Tkinter: Remove window border

How do you remove the border of a TopLevel without using overrideredirect? TopLevel.overrideredirect(True) It would be great if a sample code can be provided. Python 2.7.3, Linux, Tkinter version ...
0
votes
1answer
28 views

Python 3 Latin to English simple gui button translator

I'm new to the Pyhton GUI and have been playing around, for some time now, with the code below. The Latin to English translator code below works by displaying three buttons with each having a Latin ...
0
votes
1answer
22 views

'image “pyimage2” doesn't exist'?

This is where the error is found: global backbuttonimg backbuttonimg = PhotoImage(file="backbutton.gif") C6 = tkinter.Button(W_CheckDates, image=backbuttonimg, command = CheckDatesBack) C6.pack() I ...
1
vote
1answer
19 views

How to set the root window size to half of the screen width and height Python Tkinter

I am trying to get the width and height of the users monitor size. Which I can get that but now my main problem is how to set the root window to half the width ad height but I have run into a wall and ...
0
votes
1answer
21 views

Understanding the logic of Tkinter mainloop() and why variables are not reassigned their original values?

From my understanding window.mainloop() keeps repeating the GUI code so that the window and its widgets stay on the screen. Why, therefore, can a variable (such as canvastext) be updated and stay ...
-2
votes
3answers
33 views

python tkinter Toplevel .destroy() vs .quit() not working as intended

I have a class Duplicates that checks for duplicates within 40 words. I have a class Window that creates and runs the main window where i post the result. I have a class popWindow that creates a ...
0
votes
1answer
39 views

A solution to using both the .pack() and .grid() method in the same tkinter window?

So I have been playing around with widgets in Tkinter and due to an issue (which was solved on this forum) I realise that you can't have .pack() and .grid() methods to organise different widgets in ...
1
vote
2answers
24 views

tkinter option menu - update options on fly

I'm creating a GUI using Tkinter with Python 2.7.6. I have a drop down menu, created and initially disabled with the following code: self.dropdown = Tkinter.OptionMenu(self, self.dropdownVar, ...
1
vote
1answer
31 views

keeping console control in tkinter using threading

I'm trying to set up a tkinter window that I can interact with outside of the main loop, using a queue. When I interpret this in spyder, it works fine. after launch()-ing, my Tk window appears, and I ...
0
votes
1answer
22 views

Making buttons disappear in Tkinter

I'm doing a coding project at school and I'm trying to set up functions for my buttons but when i run the code the buttons run the commands without being clicked and they don't dissapear because the ...
0
votes
1answer
18 views

Issues applying a scroll bar to a canvas widget in Tkinter

I'm playing around with Tkinter widgets and am trying to apply a scroll bar to a canvas widget but when the program is run it hangs - no error message etc. Firstly is the general logic to attach a ...
0
votes
3answers
46 views

Python TkInter - Update Label Text

Is there any possible way to create a TkInter label that uses a string and a variable as the text? For example: name = "bob" Label(root, text="hello, my name is "+name) But instead of that only ...
-1
votes
2answers
39 views

How to set specific text to Entry in Python?

I'm working on getting a python/tkinter label widget to update its contents. Per an earlier thread today, I followed instructions on how to put together the widgets. At runtime, however, the label ...
-2
votes
0answers
14 views

Validate Entry Tkinter, Python

This is what I tried but it doesn't work. I also tried while but it never opened. if not(areacode_get.isdigit() and len(areacode_get) == 3 or phrase_get.isalnum and len(phrase_get) >= 7): ...
0
votes
0answers
8 views

How do I use py2app with a virtual environment?

I'm trying to create an app with py2app and a simple Tkinter Python 3 program. My setup.py file is the default one created when running the py2applet --make-setup command. When I try to build the app, ...
0
votes
1answer
35 views

How to add a partially transparent image to Tkinter?

I am making a game in Tkinter and I would really like partially transparent images in the game for obvious reasons... How would I do that? PNG doesn't allow transparency, and JPEG does allow ...
0
votes
1answer
17 views

Error in python when using .config() on a Label

Ok, so I have a problem. I am trying to make a GUI Hex converter and i Keep getting the same error. I am not that experienced with Tkinter, so can someone help me? Here is the Code: from Tkinter ...
0
votes
1answer
26 views

How can I return a value into the main program when calling a function with a keyboard event in TKinter?

I am trying to play around with tkinter and keyboard input events. How can I develop the code below so that when a key is pressed (eg up arrow), a function is called that increments some global ...
0
votes
1answer
30 views

TypeError: takes exactly 1 argument (2 given)

I'm new to programming, learnt python syntax. Stuck at my first GUI program! Here is my code: #User name userLabel = Label(self.signView, text="User Name") userLabel.grid(sticky = E) self.userEntry ...
0
votes
1answer
26 views

Month/Year clock ingame stopping the rest of my game

I am using Tkinter to make a RISK type game (sort of closer to Empire) and I am trying to make an ingame clock for troop reinforcement and money gain. The problem is: When I run it, the while loop ...
0
votes
1answer
33 views

Python Tkinter: Progress bar does not get minimized when main application gets minimized

Please run the following example. I have created a progress bar for my application, and by pressing the "Open" button a progress bar pops up. However, the progress bar does not get minimized when ...
0
votes
2answers
43 views

Using matplotlib's ginput function with tkinter GUI

I have built a simple matplotlib plotting GUI in python using tkinter. Now I would like to to ginput to obtain coordinates from the plot. Unfortunately I keep receiving the following errors: ...
0
votes
1answer
24 views

Options Menu in python

I have the following code : from Tkinter import * import Tkinter as ttk from ttk import * win=Tk() OPTIONS=["PIM","RR"] var = StringVar() option = OptionMenu(win, var, *OPTIONS ) option.pack() ...
0
votes
1answer
33 views

Why default text entry Python Tk not work when is a function?

I would like to know why the default text does not appear on the entry field. On the same screen everything works fine. The problem is when I call the function from another file. I have this ...
0
votes
1answer
28 views

Python Tkinter: Progress bar malfunction when using multi-threading

Please run the following example. I have created a progress bar for my application, and by pressing the "Open" button a progress bar pops up. However, the progress bar does not fill up and it appears ...
-2
votes
1answer
38 views

Finding an Area of a Polygon using coordinates using tkinter

I'm trying to make a calculator for finding an area for a polygon using coordinates with the help of Tkinter. What I have so far is the following... from tkinter import * class AreaCalculator: ...
0
votes
1answer
8 views

Scroll bar with child window in Tkinter

I mostly copied the code from here and it does produce a new frame made with a canvas and a scroll bar on the side, but the scroll bar doesn't work/isn't enabled. Here's the method that creates the ...
-5
votes
1answer
60 views

i cant use the equals or the enter key on my keyboard to get an answer for anything

ok i am using this code for educational purposes and if i go 45+54 and hit enter key i dont get any answer but if use the = on the screen not on my keyboard it works. i am so stuck and stressed out ...
2
votes
1answer
34 views

Hiding TKinter root window while showing modal window

I have a TKinter-based application that attempts to manage settings for a game. Users may have multiple versions of this game installed, and in that case, I need to ask the user which installation ...
-2
votes
1answer
38 views

Python Tkinter can't select option in optionmenu

I am having the problem where I am able to populate two optionmenus using Tkinter, (the second one dynamically based off the first), but I notice when I try to select one of the values in the second ...