Re: Tkinter problem

2021-06-20 Thread Christian Gollwitzer
Am 19.06.21 um 08:48 schrieb Jach Feng: Christian Gollwitzer 在 2021年6月19日 星期六下午1:54:46 [UTC+8] 的信中寫道: I guess you wanted to post another question? Then please open a new thread. In addition, the question is unclear, you just posted a transcript of three lines of Python. I posted to point out

Re: Tkinter problem

2021-06-19 Thread Christian Gollwitzer
Am 19.06.21 um 07:16 schrieb Jach Feng: Christian Gollwitzer 在 2021年6月19日 星期六下午12:27:54 [UTC+8] 的信中寫道: Am 19.06.21 um 05:59 schrieb Jach Feng: import tkinter as Tk Tk from tkinter import * Tk tkinter Traceback (most recent call last): File "", line 1, in NameError: name 'tkinter' is not

Re: Tkinter problem

2021-06-19 Thread Terry Reedy
On 6/18/2021 2:28 AM, Liya Ann Sunny wrote: I am using Colab. How could solve this problem. import tkinter as Tk If you do this, import 'as tk'. from tkinter import * The second import overwrites the first since it imports tkinter.Tk as 'Tk'. Don't try to do both. import sys import os

Re: Tkinter problem

2021-06-19 Thread Christian Gollwitzer
Am 19.06.21 um 05:59 schrieb Jach Feng: import tkinter as Tk Tk from tkinter import * Tk tkinter Traceback (most recent call last): File "", line 1, in NameError: name 'tkinter' is not defined What's the point? That has no relation to the question. "import A as B" does not define

Re: Tkinter problem

2021-06-19 Thread Jach Feng
Christian Gollwitzer 在 2021年6月19日 星期六下午1:54:46 [UTC+8] 的信中寫道: > Am 19.06.21 um 07:16 schrieb Jach Feng: > > Christian Gollwitzer 在 2021年6月19日 星期六下午12:27:54 [UTC+8] 的信中寫道: > >> Am 19.06.21 um 05:59 schrieb Jach Feng: > >> import tkinter as Tk > >> Tk > >>> >>> 'C:\\Users\\jfong\\AppData

Re: Tkinter problem

2021-06-19 Thread Jach Feng
Christian Gollwitzer 在 2021年6月19日 星期六下午12:27:54 [UTC+8] 的信中寫道: > Am 19.06.21 um 05:59 schrieb Jach Feng: > import tkinter as Tk > Tk > > > 'C:\\Users\\jfong\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\tkinter\\__init__.py'> > > > from tkinter import * > Tk > >

Re: Tkinter problem

2021-06-19 Thread Jach Feng
liyaanns...@gmail.com 在 2021年6月18日 星期五下午2:28:35 [UTC+8] 的信中寫道: > I am using Colab. How could solve this problem. > import tkinter as Tk > from tkinter import * > import sys > import os > #create main window > master = Tk() > master.title("tester") > master.geometry("300x100") > > > #make

Re: Tkinter problem

2021-06-18 Thread Christian Gollwitzer
Am 18.06.21 um 08:28 schrieb Liya Ann Sunny: I am using Colab. How could solve this problem. TclError: couldn't connect to display ":0.0" You're either not running an X server, or having problems to connect to it. Are you sure that Google Colab supports X11 at all? This link doesn't seem to

Re: Tkinter problem: TclError> couldn't connect to display ":0

2016-02-05 Thread Dave Farrance
gemjack...@gmail.com wrote: >This fixed my problem with thkinter. sudo cp ~/.Xauthority ~root/ Which means that you were creating a GUI window with Python as root, which is to be avoided if you can. If you can't avoid it and you're running it with sudo in a bash console, rather than a root

Re: Tkinter problem: TclError> couldn't connect to display ":0

2016-02-04 Thread gemjack . pb
On Sunday, 29 December 2013 20:20:00 UTC, Michael Matveev wrote: > Hi, > I use live Debian on VM and trying to compile this code. > > > import Tkinter > > root = Tkinter.Tk() > > root.title("Fenster 1") > root.geometry("100x100") > > root.mainloop() > > > The shell gives out that kind of

Re: Tkinter problem: TclError> couldn't connect to display ":0

2013-12-29 Thread Jason Swails
On Sun, Dec 29, 2013 at 10:29 PM, Steven D'Aprano wrote: > On Mon, 30 Dec 2013 10:30:11 +1100, Chris Angelico wrote: > > > On Mon, Dec 30, 2013 at 10:22 AM, Steven D'Aprano > > wrote: > >> So you need to X-forward from the remote machine to the machine you are > >> physically on, or perhaps it's

Re: Tkinter problem: TclError> couldn't connect to display ":0

2013-12-29 Thread Chris Angelico
On Mon, Dec 30, 2013 at 2:29 PM, Steven D'Aprano wrote: > On Mon, 30 Dec 2013 10:30:11 +1100, Chris Angelico wrote: > >> On Mon, Dec 30, 2013 at 10:22 AM, Steven D'Aprano >> wrote: >>> So you need to X-forward from the remote machine to the machine you are >>> physically on, or perhaps it's the o

Re: Tkinter problem: TclError> couldn't connect to display ":0

2013-12-29 Thread Steven D'Aprano
On Mon, 30 Dec 2013 10:30:11 +1100, Chris Angelico wrote: > On Mon, Dec 30, 2013 at 10:22 AM, Steven D'Aprano > wrote: >> So you need to X-forward from the remote machine to the machine you are >> physically on, or perhaps it's the other way (X is really weird). I >> have no idea how to do that,

Re: Tkinter problem: TclError> couldn't connect to display ":0

2013-12-29 Thread Chris Angelico
On Mon, Dec 30, 2013 at 10:22 AM, Steven D'Aprano wrote: > So you need to X-forward from the remote machine to the machine you are > physically on, or perhaps it's the other way (X is really weird). I have no > idea how to do that, but would love to know. With SSH, that's usually just "ssh -X tar

Re: Tkinter problem: TclError> couldn't connect to display ":0

2013-12-29 Thread Steven D'Aprano
Michael Matveev wrote: > Hi, > I use live Debian on VM and trying to compile this code. > > > import Tkinter > > root = Tkinter.Tk() > > root.title("Fenster 1") > root.geometry("100x100") > > root.mainloop() > > > The shell gives out that kind of message: > > File "test.py", line 5, in

Re: Tkinter problem: TclError> couldn't connect to display ":0

2013-12-29 Thread Chris Angelico
On Mon, Dec 30, 2013 at 7:20 AM, Michael Matveev wrote: > The shell gives out that kind of message: > > File "test.py", line 5, in > root = Tkinter.Tk() > File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1712, in __init__ > self.tk = _tkinter.create(screenName, baseName, className, interactive,

Re: tkinter problem

2009-07-10 Thread Paul Simon
"David Smith" wrote in message news:h35f78$pt...@ruby.cit.cornell.edu... > Paul Simon wrote: >> "Peter Otten" <__pete...@web.de> wrote in message >> news:h3481q$d95$0...@news.t-online.com... >>> Paul Simon wrote: >>> "Chris Rebert" wrote in message news:mailman.2863.1247095339.8015.py

Re: tkinter problem

2009-07-09 Thread David Smith
Paul Simon wrote: > "Peter Otten" <__pete...@web.de> wrote in message > news:h3481q$d95$0...@news.t-online.com... >> Paul Simon wrote: >> >>> "Chris Rebert" wrote in message >>> news:mailman.2863.1247095339.8015.python-l...@python.org... >>> On Wed, Jul 8, 2009 at 4:18 PM, Paul Simon wrote:

Re: tkinter problem

2009-07-09 Thread Terry Reedy
Paul Simon wrote: "Peter Otten" <__pete...@web.de> wrote in message news:h3481q$d95$0...@news.t-online.com... Paul Simon wrote: I"m using Mandriva 2008.1. I have to tell you honestly that I'm not sure exactly how I installed Python. Originally I had installed 2.5 from RPM but 2.6 was not a

Re: tkinter problem

2009-07-09 Thread Peter Otten
Paul Simon wrote: > > "Peter Otten" <__pete...@web.de> wrote in message > news:h3481q$d95$0...@news.t-online.com... >> Paul Simon wrote: >> >>> "Chris Rebert" wrote in message >>> news:mailman.2863.1247095339.8015.python-l...@python.org... >>> On Wed, Jul 8, 2009 at 4:18 PM, Paul Simon wrote: >>

Re: tkinter problem

2009-07-09 Thread Paul Simon
"Peter Otten" <__pete...@web.de> wrote in message news:h3481q$d95$0...@news.t-online.com... > Paul Simon wrote: > >> "Chris Rebert" wrote in message >> news:mailman.2863.1247095339.8015.python-l...@python.org... >> On Wed, Jul 8, 2009 at 4:18 PM, Paul Simon wrote: >>> I have the "tkinter" proble

Re: tkinter problem

2009-07-09 Thread Peter Otten
Paul Simon wrote: > "Chris Rebert" wrote in message > news:mailman.2863.1247095339.8015.python-l...@python.org... > On Wed, Jul 8, 2009 at 4:18 PM, Paul Simon wrote: >> I have the "tkinter" problem and need some assistance to straighten it >> out. >> >From the web page "http://wiki.python.org/moi

Re: tkinter problem

2009-07-08 Thread Paul Simon
"Chris Rebert" wrote in message news:mailman.2863.1247095339.8015.python-l...@python.org... On Wed, Jul 8, 2009 at 4:18 PM, Paul Simon wrote: > I have the "tkinter" problem and need some assistance to straighten it > out. > >From the web page "http://wiki.python.org/moin/TkInter"; I tested as i

Re: tkinter problem

2009-07-08 Thread Chris Rebert
On Wed, Jul 8, 2009 at 4:18 PM, Paul Simon wrote: > I have the "tkinter" problem and need some assistance to straighten it out. > >From the web page "http://wiki.python.org/moin/TkInter"; I tested as in "step > 1" and cannot import "_tkinter." I do not have that file on my computer, but > do have t

Re: TkInter: Problem with propagation of resize events through geometry manager hierarchy?

2009-02-08 Thread James Stroud
curiouserra...@gmail.com wrote: Thanks! I hadn't known about the "return 'break'" technique. But I don't follow your sentinel suggestion; how would that sentinel ever get reset? Presumably you would set it from some kind of input. Basically, if you don't need to zoom, you wouldn't bother sca

Re: TkInter: Problem with propagation of resize events through geometry manager hierarchy?

2009-02-08 Thread curiouserrandy
On Feb 8, 6:27 am, James Stroud wrote: > I can't test your code because I don't have the test image and for some > reason it does not recognize a tiff of my own. But, just glancing at > your code, it looks like a quick-fix would be to set self.zoom to a > sentinel at the end of refresh() and retu

Re: TkInter: Problem with propagation of resize events through geometry manager hierarchy?

2009-02-08 Thread James Stroud
Randy Smith wrote: The cropping and scrolling works fine. But when I try to add responding to resize events, I get into trouble. Specifically: * When I naively change the size of the image shown to be borderwidth less than the size indicated in the configure event, the size of the image sho

Re: Tkinter - problem closing window

2009-01-07 Thread Djames Suhanko
Wow, nice! But, with join i can't padding with 0. '-'.join(str(random.randint(0, 60)) for dummy in xrange(6)) Then, i has been used: a[i] = "%02d" % int(random.randint(0,60)) I will change int(random.randint(0,60)) for random.randint(0,60), only. Thank you, guys !! ;-) The problem was solved whe

Re: Tkinter - problem closing window

2009-01-06 Thread Marc 'BlackJack' Rintsch
On Mon, 05 Jan 2009 12:25:53 -0200, Djames Suhanko wrote: > I has a litle program that open another window. When I close de root > window in quit button, I need clicking 2 times to close. is where the > problem? > > […] > > 17 def gera_seis(self): > 18a = {} > 19for i in range(6): >

Re: Tkinter - problem closing window

2009-01-05 Thread Collin D
On Jan 5, 9:21 am, Roger wrote: > On Jan 5, 11:52 am, Collin D wrote: > > > > > On Jan 5, 6:25 am, "Djames Suhanko" wrote: > > > > Hello! > > > I'm sorry my terrible english (my native language is portuguese). > > > I has a litle program that open another window. When I close de root > > > windo

Re: Tkinter - problem closing window

2009-01-05 Thread Roger
On Jan 5, 11:52 am, Collin D wrote: > On Jan 5, 6:25 am, "Djames Suhanko" wrote: > > > > > Hello! > > I'm sorry my terrible english (my native language is portuguese). > > I has a litle program that open another window. When I close de root > > window in quit button, I need clicking 2 times to cl

Re: Tkinter - problem closing window

2009-01-05 Thread Collin D
On Jan 5, 6:25 am, "Djames Suhanko" wrote: > Hello! > I'm sorry my terrible english (my native language is portuguese). > I has a litle program that open another window. When I close de root > window in quit button, I need clicking 2 times to close. is where the > problem? > > The source: >   1 #!

Re: Tkinter - problem closing window

2009-01-05 Thread Peter Otten
Djames Suhanko wrote: > Hello! > I'm sorry my terrible english (my native language is portuguese). > I has a litle program that open another window. When I close de root > window in quit button, I need clicking 2 times to close. is where the > problem? > > The source: > 1 #!/usr/bin/env python

Re: Tkinter Problem?

2007-11-20 Thread Davy
Hi all, I have solved the problem after read some code. Because Tk.Canvas do not have a focus, it does not receive a key input. The solution is bind key input to the highest level 'root' root.bind('',self._onUpKey) Davy On Nov 20, 10:13 am, Davy <[EMAIL PROTECTED]> wrote: > Hi all, > > I have w

Re: Tkinter Problem?

2007-11-20 Thread Peter Otten
Marc 'BlackJack' Rintsch wrote: > On Mon, 19 Nov 2007 18:13:03 -0800, Davy wrote: > >> ##-- >> from Tkinter import * >> >> class MyApp: >> def __init__(self,parent): >> self.myContainer1 = Frame(parent) >> self.myContainer1.pack() >> self.canv = Ca

Re: Tkinter Problem?

2007-11-19 Thread Marc 'BlackJack' Rintsch
On Mon, 19 Nov 2007 18:13:03 -0800, Davy wrote: > ##-- > from Tkinter import * > > class MyApp: > def __init__(self,parent): > self.myContainer1 = Frame(parent) > self.myContainer1.pack() > self.canv = Canvas(relief=SUNKEN) > self.canv.confi

Re: Tkinter Problem?

2007-11-19 Thread kyosohma
On Nov 19, 8:13 pm, Davy <[EMAIL PROTECTED]> wrote: > Hi all, > > I have written a simple Tkinter program, that is draw a rectangle in a > canvas, when I press Up key, the rectangle move up. But the program > seems work not properly? My environment is Python2.5+PythonWin. > > ##

Re: Tkinter problem

2006-07-08 Thread Nick Craig-Wood
Simon Forman <[EMAIL PROTECTED]> wrote: > Just an idea, but if you're sure that > /usr/lib/python2.4/lib-dynload/_tkinter.so exists, check it's > permissions and the permissions of /usr/lib/python2.4/lib-dynload/ Also run ldd on it - you could be missing a library eg $ ldd /usr/lib/python2.4/

Re: Tkinter problem

2006-07-07 Thread Simon Forman
Jim Anderson wrote: > I'm running Kubuntu a derivative of Debian Linux. I'm using > Python 2.4 and tcl/tk 8.4. I'm running Tkinter programs and > they were running about a month ago. When I tried them again > yesterday, I got the following message: > > > python ~/prog/python/iodef/iodef.py > > Tr

Re: Tkinter problem on Mac OS X

2006-04-10 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Andrew Trevorrow) wrote: > Our app uses embedded Python to allow users to run arbitrary scripts. > Scripts that import Tkinter run fine on Windows, but on Mac OS X there > is a serious problem. After a script does "root = Tk()" our app's menus

Re: Tkinter problem on Mac OS X

2006-04-09 Thread James Stroud
Andrew Trevorrow wrote: > Our app uses embedded Python to allow users to run arbitrary scripts. > Scripts that import Tkinter run fine on Windows, but on Mac OS X there > is a serious problem. After a script does "root = Tk()" our app's menus > are permanently changed in the following way: > > -

Re: TKinter problem

2006-03-21 Thread ezd
C D Wood wrote: > To whom this may concern, > Below is the source code, which > > demonstrates a > problem I am having making a GUI for my python project work. > 'table.txt' > is a file that is read from the same folder. > > My code writes to a text file 'ta

Re: Tkinter problem

2005-11-01 Thread dale cooper
Thanks! At this moment I can see the first python generated Tk window on my screen. It's great ;-))) -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter problem

2005-10-31 Thread jepler
On Mon, Oct 31, 2005 at 03:17:05PM -0800, dale cooper wrote: > Thanks, but I've got another question: > > can't find Tcl configuration script "tclConfig.sh" This file comes from the following package: $ rpm -qf /usr/lib*/tclConfig.sh tcl-devel-8.4.9-3 Fedora generally splits packages which are

Re: Tkinter problem

2005-10-31 Thread dale cooper
Thanks, but I've got another question: can't find Tcl configuration script "tclConfig.sh" This is what I received trying to install TkBLT. What is tclConfig.sh? I did installed tcl/tk 8.4.9-3 as I mentioned before, I tried to find this file, but I don't have it in my filesystem. How to get it? -

Re: Tkinter problem

2005-10-31 Thread Fredrik Lundh
"dale cooper" wrote: > I've recently installed python2.4.2 on Fedora 4 (from downloaded > sources), but it appeared, that I can't use Tkinter module: > import Tkinter > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", line 38, i

Re: [Tkinter] problem

2005-01-29 Thread Jeff Epler
These lines > if __name__ == '__main__': > OptionsWindow() mean "if this source code is the main program (not an imported module), call OptionsWindow()". So the behavior should be different when the source code is the main program ('python opt_newlogin.py') and when it's imported ('python -c "