I want to use the response from an askstring prompt to set a variable. Unfortunately,
I have the dilemma that I'm trapped in the loop asking the question or the window refuses to draw because the variable (urltoopen) has no value.
The code as it stands:
urltoopen = tkSimpleDialog.askstring('Address', 'Where do we get the pictures from?...
I am trying to use the invoke method of a ttk.Button, as shown at TkDocs (look at "The Command Callback"), but I keep getting this error:
AttributeError: 'NoneType' object has no attribute 'invoke'
So, I tried this in the Interactive Shell:
ActivePython 3.1.1.2 (ActiveState Software Inc.) based on
Python 3.1.1 (r311:74480,...
The MSI installers downloadable from python.org does not include Tcl/Tk header (not source) files (that are required to compile some packages like matplotlib). Does anyone know of the rationale behind not including them?
...
I have a problem in Python.
I'm using Tkinter and have four bind events, that listen to key presses on my form.
My problem is, that these don't run asynchronously. So, for example I can press one button, and the events are recognized. But when I press and hold two keys at the same time, just one event gets fired.
Is there an alternativ...
I am using Python 3.1 by the way.
I am trying to build a simple GUI using Tkinter - label, text entry field, button on the first row and editable text area with scrollbar to the right and on the bottom of it - on the second row. Please help me fix up the layout. What I have below does not quite work. If I have to use a grid, I will. I w...
I'm trying do a executable for windows for a gui aplication in tkinter using the ttk, I made a exe with cx_freeze, but when run the app in the console, it give me the following error.
D:\My Dropbox\python\SAR Calculator\src\dist_tk>
Traceback (most recent call last):
File "C:\Python31\lib\site-packages\cx_Freeze\
7, in <modul...
I'm attempting to learn some Python and Tkinter. The sample code below is intended to put two windows on the screen, a few buttons, and a Canvas with an image in it and some lines drawn on it.
The windows and buttons appear just fine, however I'm not seeing either the canvas image or canvas lines. I'd appreciate some help to figure ou...
Hello, I want to show my calculated output to Gui window in python.I am trying with Tkinter.But having problem to get output on Tkinter level widget.The thing is that, I am putting input data as address information in text field of Tkinter window and want latitude , longitude of that inputed address to the text label. Can anyone please h...
Hi,
I am having trouble getting Tkinter up and runnning in order to install matplot lib.
I am running Mac OS X 10.4.11, and just installed Python 2.6.4 .
After several other fights, one remaining battle for me to get matlotlib installed is to have a working version of Tkinter, although there are several in my Mac from Xcode and also ...
from Tkinter import *
root = Tk()
root.title("Whois Tool")
text = Text()
text1 = Text()
text1.config(width=15, height=1)
text1.pack()
def button1():
text.insert(END, text1)
b = Button(root, text="Enter", width=10, height=2, command=button1)
b.pack()
scrollbar = Scrollbar(root)
scrollbar.pack(side=RIGHT, fill=Y)
text.config(...
I'm trying to clear the entry widget after the user presses a button using tkinter in python. I tried using ent.delete(0,END) but I got an error saying that strings dont have the attribute delete
here is my code: I'm getting error on real.delete(0, END).
secret = randrange(1,100)
print(secret)
def res(real, secret):
if secret==eval...
from Tkinter import *
import socket, sys
from PIL import Image, ImageTk
root = Tk()
root.title("Whois Tool")
root.resizable(0, 0)
text = Text()
text1 = Text()
image = Image.open("hacker2.png")
photo = ImageTk.PhotoImage(image)
label = Label(root, image=photo)
label.pack()
text1.config(width=15, height=1)
text1.pack()
def button1()...
b = Button(root, text="Enter", width=10, height=2, command=button1)
b.config()
b.pack(side=LEFT)
c = Button(root, text="Clear", width=10, height=2, command=clear)
c.pack(side=LEFT)
scrollbar = Scrollbar(root)
scrollbar.pack(side=RIGHT, fill=Y)
text.config(width=35, height=15)
text.pack(side=RIGHT, fill=Y)
scrollbar.config(command=text...
from Tkinter import *
import socket, sys, os
import tkMessageBox
root = Tk()
root.title("File Deleter v1.0")
root.config(bg='black')
root.resizable(0, 0)
text = Text()
text3 = Text()
frame = Frame(root)
frame.config(bg="black")
frame.pack(pady=10, padx=5)
frame1 = Frame(root)
frame1.config(bg="black")
frame1.pack(pady=10, padx=5)
t...
I have two large identical-sized files. One is ASCII plain text, and the other is a colour-coded overlay, one byte per text character in the corresponding file.
These files can be large - upto 2.5 MB; possibly substantially more, perhaps over 100MB later.
I want to display the text is a scrollable text viewer, using the second file as...
I'd like to use the nltk toolkit on my machine which runs Ubuntu 9.04. I installed python 2.6.4 and several additional packages (numpy, scipy, matplotlib and of course nltk). I can import nltk, but calling a few methods gives various error masseges, all contain "please install Tkinter library".
Googling around I discovered from http://wi...
button1 = tkinter.Button(frame, text="Say hi", command=print)
button2 = tkinter.Button(frame, text="foo", command=print)
button3 = tkinter.Button(frame, text="bar", command=print)
You've probably spotted the hole in my program: print can't specify arguments. This renders the whole thing useless and faulty. Obviously, having something l...
In Python using Tkinter, what is the difference between root.destroy and root.quit when closing the root window?
Is one prefered over the other? Does one release resources that the other doesn't?
...
I use python 2.6 under linux (SUSE Linux Enterprise Desktop 11 (x86_64)). I tested some very simple code :
import tkColorChooser
tkColorChooser.askcolor()
then if I click on cancel, I always get error like:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.6/lib-tk/tkColorChooser.py",...
How would i print contents of a Python Tkinter.Canvas control?
I've read that it is possible to print to a postscript printer from this control but examples are hard to come by.
So, any ideas how what is needed to print the contents (including images)? If you've got a cross-platform method all the better!
...