Tagged Questions
0
votes
1answer
17 views
Clipboard is not set after application exits?
With this example from How do I copy a string to the clipboard on Windows using Python? :
from tkinter import Tk
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('i can has clipboardz?')
...
1
vote
1answer
15 views
Used a for loop to create a certain number of entry boxes but can only .get last value from last entrybox
I am new to Python and I'm trying to create a simple grade calculator with tkinter.
I used a loop to create a number of entryboxes as defined by the user-- for entering grades.
However, I don't know ...
0
votes
1answer
21 views
How to show text on Entry on Tkinter?
I am trying to make a simple calculator with GUI. So what I have so far are the buttons and the Entry box setup but I have no idea how to display text on them. So Currently, the "equation" is equal to ...
0
votes
1answer
23 views
Python 3 tkinter iconbitmap error in ubuntu
Well I have this:
import tkinter
gui = tkinter.Tk()
gui.iconbitmap(default='/home/me/PycharmProjects/program/icon.ico')
gui.mainloop()`
But when I run I get an error saying
Traceback (most recent ...
-1
votes
1answer
19 views
turtle.ontimer() equivalent for tkinter
I am writing a program that requires the tkinter canvas to update graphics. In its previous form it was written in turtle. The turtle function to update the canvas is
turtle.ontimer()
Is there a ...
0
votes
0answers
14 views
tkinter overrideredirect function
I would like to create a window without title bar but I don't want the user to be able to move or 'iconify' the window. This window has to be a normal window, not "ontop" window.
The code bellow works ...
1
vote
1answer
17 views
Tkinter: Instatiate Object with Button
I am messing around with tkinter in Python 3.3 and was wondering how would I go about using/creating an object with a button. I have the following code:
from tkinter import *
class Person:
def ...
0
votes
0answers
16 views
Error with StringVar “get” method inheritance with ttk
I'm using Python 2.7.5 on a Windows 7 machine.
I defined a subclass of the Tkinter StringVar that triggers the execution of a specified function when the variable is set. I just started ...
-3
votes
0answers
36 views
button to return £2 and add £2 each time it is pressed [on hold]
I have this code and want each button to return a value of £2, and add £2 each time a button is pressed, to a running total:
#buttons
btn1=tkinter.Button(app, text="bottle", width=15, fg="green", ...
0
votes
1answer
27 views
Creating a display table with Tkinter
I found some code here: Creating a table look-a-like Tkinter
and am trying to amend it to display a table of values. My problem is the the 'headings' are overwriting one of the rows and I can't seem ...
1
vote
0answers
19 views
tkinter window not coming up while using python 3.3.3 32 bit but works fine on 64 bit
If i run the script directly(using python command), it works both on 32 as well as 64 bit python 3.3.3 installation.
But my task is to integrate(As Addin/Extension) it to Enterprise Architect and ...
0
votes
1answer
13 views
Make Tkinter.Listbox selection persist
I have a program where I need to take a selection from Tkinter.Listbox and an entry field and do something with that data. However, if I highlight any text within the entry field (i.e., to delete ...
0
votes
1answer
18 views
How to bind a keypress to a button in Tkinter
My Senior Project involves a robot I can control over wifi. I am using a Raspberry Pi and a Tkinter window to send commands to the robot. I have the rough draft of my Tkinter window, but I am ...
0
votes
1answer
13 views
Python - Tkinter window and endless loop class at the same time [duplicate]
I've got the problem that I want to call some code after the mainloop of Python which is written in a secound class. But this Class contains a possible endless loop which will cause Tkinter to freeze ...
0
votes
0answers
14 views
How to update an entry widget after a '<Key>' event
I have an entry widget in my app that is used to search for matches in a database. I want the search results to be displayed dynamically as the query is being typed in. The relevant part of my code ...
0
votes
1answer
16 views
Tkinter with Python 3.3 : Change colour of button on click
So I have been playing with tkinter to try add a gui to a lift simulator project I have written for university. It is not really needed, but I would like to add it.
Here is the code that I currently ...
0
votes
1answer
31 views
Need to return a value for a parent function - python
I'm using python 2.7.5 on mac OSX
in my code I have a function that needs to return a value. Within the function I want my callback function (tkinter) to make it's parent function to return a value, ...
0
votes
2answers
17 views
How to update the window during a callback?
When a Tkinter button is clicked and the command is run, the GUI seems frozen until the command returns.
Example, the counter wont update until after 2 seconds:
import tkinter as tk
import time
...
0
votes
0answers
41 views
Add shadow borders to custom drawn window
I'm designing a custom drawn window with Tkinter (or any other, like wxWidgets)
import Tkinter as tk
app=tk.Tk()
app.overrideredirect(True)
app.geometry("500x500+100+100")
app.mainloop()
I would ...
0
votes
0answers
15 views
Making the dialogue box hold more questions
I have the following code:
import tkinter
def From_Email(self):
class GetFromEmail(object):
def __init__(self,requestMessage):
self.root = Tk()
...
0
votes
2answers
35 views
loading from a .txt file, no file directory
When i run this code i get an error saying the file does not exist, i have created the file and linked back to them by copying the directory from the save part. I can also see the file and have triple ...
1
vote
1answer
22 views
Why it shows blank instead of picture in my Tkinter program?
I want to use Tkinter to display all the pictures in a specific directory, so I firstly code to show all the pictures from a given list
The code is:
import os
from Tkinter import *
from PIL import ...
1
vote
1answer
15 views
Python: Tkinter only opening after keyboard interrupt
need some help with a revision program. The code I have written below only opens the tkinter box after I have stopped the program with a keyboard interrupt - Any help would be greatly appreciated!
...
0
votes
1answer
19 views
Trying to create a dynamic menu with a common command function
I'm trying to dynamically create a RECENT FILES menu from a list, then use a common function to process the selected file.
Windows 7, Python 2.7
I can successfully create the menu, but haven't been ...
1
vote
2answers
23 views
TkMessageBox for user response
Is tkMessageBox able to ask a question that will allow user response in text form. I have tried messagebox.askquestion() which only gives yes no and I have also tried messagebox.showinfo()
Thanks!
0
votes
0answers
16 views
Tkinter, Text collection dialog with additional checkbox
I've been trying with poor results to create a dialog that takes focus, asks for a search string and has an additional "use regex" checkbox.
I need the widget to remain in memory so the last search ...
0
votes
2answers
28 views
how to use scale.set() using values from a .txt file
I have created a file which saves the values of 2 sliders, i now want to be able to recall values from this file to set the value of the sliders, can somebody tell me how to do this, this is my ...
0
votes
1answer
21 views
How do I set focus to an entry widget from a function
I have a class with several functions, one of them throws an exception and I would like to set the focus back to the entry widget it is validating. calling:
self.entryWidget.set_focus()
returns an ...
0
votes
2answers
21 views
Calling a function on form load
I have a program that contains a function that grabs information from text file a populates labels. How can I have this function called on loading of the form? I tried calling it like this:
class ...
4
votes
0answers
65 views
Creating a circle that changes in size depending on score in Tkinker (Python)
I really don't know Tkinter very well, I'm not even sure this is possible to do. But basically I want a visual representation of the score the user gets in the game i've programmed. As it works ...
1
vote
0answers
30 views
Global hotkey on windows with tkinter
I want a python tkinter application to register a global hotkey (triggered even if the application has not the focus). I've found some pieces, but I can't find a way to put them together...
...
0
votes
1answer
36 views
Assigning values to buttons in Tkinter and appending them in a list (Python)
Beginner here, so sorry in advance for any stupid questions =] I have huge problems making the program i'm working with graphical though. The player gets to choose between 4 options, "study, ...
0
votes
1answer
43 views
Trying to run python 2 and python 3 on the same machine, having problems with 2.7 tkinter
I had python 2.7 on my machine running just fine. I decided to install python 3.3 on my computer and changed my environment variable path to C:\Python33 instead, intending that to be my main one. ...
0
votes
3answers
32 views
Make an entry more then one row. tkinter [closed]
I would like to make an entry box bigger then just one row. How can I do this?
def initUI(self):
self.parent.title("Calculator")
Style().configure("TButton",
font='serif 10')
...
0
votes
0answers
21 views
Tkinter PhotoImage not functioning as should
When ever I try to use photoimage in tkinter I get this error
File "C:\Python27\lib\lib-tk\Tkinter.py", line 2251, in _create
*(args + self._options(cnf, kw))))
TclError: image "pyimage6" doesn't ...
0
votes
3answers
51 views
print will not print val
can somebody tell me why this will not print the val. I want to print the output of the scale every time it changes.
from tkinter import *
master= Tk()
master.geometry('500x500+0+0')
def ...
0
votes
0answers
13 views
Use root permissions to run command in Mac Python Tkinter
I am writing a GUI program that runs a command and requires root permissions. How can I get a GUI pop up to ask for the user's password to then run it as root?
0
votes
1answer
22 views
Python: Server Creator - Not writing to file
new to python, just trying to create a simple minecraft server properties file creator within a GUI, I have found that it does not correctly write to file and gives me this error - "
Exception in ...
0
votes
1answer
51 views
Tk python code is ignored?
I'm making a GUI based game but for some reason a couple of lines in my code are not doing anything at all, when i know they should be.
def inspect():
if 'camera' in inv:
...
0
votes
1answer
36 views
Image not showing on a label in Tkinter
HI I'm writing a program that deals 26 cards to the user and computer. So far, I only have a button that displays the card that is at the top of the users deck.
I have a label and I have a folder of ...
0
votes
1answer
31 views
python polymorphism with Tkinter [duplicate]
I’m new to OOP programming and I’m trying to understand polymorphism in Python, all the tutorials that I find online seem very ambiguous, like this one: How does polymorphism work in Python?, it helps ...
0
votes
1answer
16 views
save scale data and recall data back into scale [closed]
I need to create a code that will take 24 scale values and save them in a txt. file, i then want to be able to recall these values and put them back into the 24 scales. can someone point me in the ...
1
vote
1answer
20 views
How can i change the font on ttk.Entry
Is there any way to change the ttk.Entry font i 've tried with the ttk.style but TypeError occures...
Like :
my_style = ttk.Style('TEntry' , font = ('Arial' , 10 , 'bold'))
my_entry = ...
0
votes
0answers
30 views
Equation not graphing properly in python program
HI I have a program that acts like a simple graphing calculator. I'm using python 2.5 and Tkinter as the GUI builder. After clicking the graph button, it opens the window and the user can enter ...
0
votes
2answers
22 views
Method runs upon it being addressed as event handler
I'm learning Tkinter and I'm pretty new to programming.
I'm trying to create a window containing a frame, containing a button that deletes the frame containing the button. This is what I've written ...
0
votes
1answer
21 views
Keeping the background colour when adding buttons to a grid/frame
The problem I'm having is keeping my background colour when adding buttons to a frame, as soon as I run the module the background colour disappears, any help will be appreciated, thanks.
Heres me ...
2
votes
2answers
36 views
Python files - Write to new line each time opened
What i'm trying to do is each time the function AppViewer_SAVE is called via a tkinter button, for it to open the file and write the data. My problem is each time the function is called and writes, it ...
0
votes
3answers
42 views
Rock Paper Scissors help needed
Can anyone please help me with this code? Its not working.
import Tkinter as t
from PIL import Image, ImageTk
import random
rockimagepath = "rock.jpg"
paperimagepath = "paper.jpg"
scissorimagepath = ...
0
votes
3answers
35 views
Variable referenced before assignment - Python
I am getting the error...
a = a + b
UnboundLocalError: local variable 'a' referenced before assignment
I don't understand why the error occurs if I have assigned the two variables a and b at the ...
1
vote
1answer
100 views
_tkinter.TclError: no display name and no $DISPLAY environment variable for new OS X Mavericks
This is my first post so please be forgiving.
I am trying to create an animation using matplotlib, and I could do this perfectly well until a few days ago, until I upgraded to OS X Mavericks, upon ...