From motus69110 at gmail.com Sun Feb 1 15:13:45 2015 From: motus69110 at gmail.com (=?UTF-8?B?UmFwaGHDq2wgU0VCQU4=?=) Date: Sun, 01 Feb 2015 15:13:45 +0100 Subject: [Tkinter-discuss] Weird bug in input widgets? (Michael Lange) In-Reply-To: References: Message-ID: <54CE3499.3040507@gmail.com> Hi Michael, Thank you for your reply, but I'm on a PC / Linux Ubuntu 14.10 with Tkinter/Tk version 8.6 for Python3, standard installation, no specific tuning. I'm working this way to fit as much as possible with customers' machines who'd use my apps, generally without making any changes to their platform pre-installed packages. I'm not looking for a bug fix on my own, I'd like to acknowledge Tkinter's dev team that this bug exists, hoping that in some late days it will be fixed everywhere for everybody. :) I thought tkinter-discuss was the best place for this. I don't know if there is a bugtracker for Tkinter somewhere. I don't even know if Tkinter is still in development, in fact. Is it? Regards. Le 31/01/2015 12:00, tkinter-discuss-request at python.org a ?crit : > Send Tkinter-discuss mailing list submissions to > tkinter-discuss at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.python.org/mailman/listinfo/tkinter-discuss > or, via email, send a message with subject or body 'help' to > tkinter-discuss-request at python.org > > You can reach the person managing the list at > tkinter-discuss-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Tkinter-discuss digest..." > > > Today's Topics: > > 1. Weird bug in input widgets? (Rapha?l SEBAN) > 2. Re: Weird bug in input widgets? (Michael Lange) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sat, 31 Jan 2015 09:20:06 +0100 > From: Rapha?l SEBAN > To: tkinter-discuss at python.org > Subject: [Tkinter-discuss] Weird bug in input widgets? > Message-ID: <54CC9036.5060705 at laposte.net> > Content-Type: text/plain; charset=utf-8; format=flowed > > Hi all, > > While working on my latest software (tkScenarist on GitHub), I > encountered a really weird issue: once cleared, input widgets such as > Text, Entry, ttk.Entry do *NOT* accept composite-accented letters > (french ?, ?, etc) any more. > > So, to get sure, I made the following test code: > > [CODE] > #!/usr/bin/env python3 > # -*- coding: utf-8 -*- > > from tkinter import * > > def clear_all (event=None): > # clear stringvars > for svar in cvars: > svar.set("") > # end for > # clear text widgets > for wtext in texts: > wtext.delete("1.0", END) > # end for > # end def > > def test (nb_of_widgets): > global root, cvars, texts > root = Tk() > root.title("test #{}".format(nb_of_widgets)) > cvars = list() > for n in range(nb_of_widgets): > svar = StringVar() > cvars.append(svar) > Entry(root, textvariable=svar).pack() > # end for > texts = list() > for n in range(nb_of_widgets): > wtext = Text(root, height=2, width=20) > wtext.pack() > texts.append(wtext) > # end for > Button(root, text="Clear all", command=clear_all).pack(side=LEFT) > Button(root, text="Quit", command=root.destroy).pack(side=RIGHT) > # events main loop > root.mainloop() > # end def > > if __name__ == "__main__": > # launch test series > for n in range(1, 4): > test(n) > # end for > # end if > [/CODE] > > Detailed description of the issue: > > * French keyboards are arranged in such a way that you must compose > accented letters as ? (e circumflex) or ? (e diaeresis) by pressing > first the '^' key and then the letter to compose with (e.g. a, e, i, o, > u, y) in order to get the final composite-accented letter (?, ?, ?, ?, > and so on); > > * when you launch the test script (cited above) and then type, let's > say, the e circumflex letter (?) into the Entry widget and into the Text > widget, respectively: > > * the first time, you'll get the right letters inserted into the input > widgets; > * then click on 'Clear all' button and enter once again the same > composite-accented letter into *ALL* the input widgets; > * secund time, only the last pack()-ed input widget will get the right > input, all other widgets will show unaccented letters; > > * the test script tries with 1 Entry and 1 Text input widgets, then with > 2 input widgets and finally with 3 input widgets; > > * each time you get the same issue: only the last pack()-ed input widget > shows the right input letter, all the rest showing unaccented letters. > > This issue is quite embarrassing for me as my latest software manages > with movie scenario scriptwriting, which *MUST* be written with correct > accents in French, otherwise all the purpose of the software would collapse. > > Is this a known issue? > > Thank you for your expert advice. > > Regards. > > Rapha?l SEBAN alias tarball69. > > > ------------------------------ > > Message: 2 > Date: Sat, 31 Jan 2015 10:29:35 +0100 > From: Michael Lange > To: tkinter-discuss at python.org > Subject: Re: [Tkinter-discuss] Weird bug in input widgets? > Message-ID: <20150131102935.7159e8d2bae539572639eb3d at web.de> > Content-Type: text/plain; charset=UTF-8 > > Hi Rapha?l, > > I cannot reproduce this behavior here (debian wheezy, Tk-8.5.11), however > I could only test it with a german keyboard layout with X-Composite key or > with dead keys temporarily enabled in xfce. I don't think that should > matter, though, here everything seems to work fine. > > I can only guess, but it sounds to me like a platform- and/or Tk-version > specific issue. If you are running OS X and a recent version of Tk it > might or might not have something to do with the bug described here: > http://sourceforge.net/p/tktoolkit/bugs/2722/ > resp. with the fix that was supplied for that bug. That is is just a shot > in the dark of course. > > Regards > > Michael > > > On Sat, 31 Jan 2015 09:20:06 +0100 > Rapha?l SEBAN wrote: > >> (snipped reply) >> _______________________________________________ >> Tkinter-discuss mailing list >> Tkinter-discuss at python.org >> https://mail.python.org/mailman/listinfo/tkinter-discuss > .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. > > Compassion -- that's the one things no machine ever had. Maybe it's > the one thing that keeps men ahead of them. > -- McCoy, "The Ultimate Computer", stardate 4731.3 > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss > > > ------------------------------ > > End of Tkinter-discuss Digest, Vol 130, Issue 8 > *********************************************** > From kw at codebykevin.com Sun Feb 1 17:44:07 2015 From: kw at codebykevin.com (Kevin Walzer) Date: Sun, 01 Feb 2015 11:44:07 -0500 Subject: [Tkinter-discuss] Weird bug in input widgets? (Michael Lange) In-Reply-To: <54CE3499.3040507@gmail.com> References: <54CE3499.3040507@gmail.com> Message-ID: <54CE57D7.7070802@codebykevin.com> On 2/1/15 9:13 AM, Rapha?l SEBAN wrote: > I don't know if there is a bugtracker for Tkinter somewhere. > I don't even know if Tkinter is still in development, in fact. > > Is it? Tkinter is just a wrapper around Tk. Here is the place to report Tk bugs: http://core.tcl.tk/tk/reportlist -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com From motus69110 at gmail.com Mon Feb 2 12:39:20 2015 From: motus69110 at gmail.com (=?UTF-8?B?UmFwaGHDq2wgU0VCQU4=?=) Date: Mon, 02 Feb 2015 12:39:20 +0100 Subject: [Tkinter-discuss] Tkinter-discuss Digest, Vol 131, Issue 1 In-Reply-To: References: Message-ID: <54CF61E8.9000606@gmail.com> Great stuff, Kevin! Thanks a lot! Regards. Le 02/02/2015 12:00, tkinter-discuss-request at python.org a ?crit : > Message: 2 > Date: Sun, 01 Feb 2015 11:44:07 -0500 > From: Kevin Walzer > To: tkinter-discuss at python.org > Subject: Re: [Tkinter-discuss] Weird bug in input widgets? (Michael > Lange) > Message-ID: <54CE57D7.7070802 at codebykevin.com> > Content-Type: text/plain; charset=windows-1252; format=flowed > > On 2/1/15 9:13 AM, Rapha?l SEBAN wrote: >> I don't know if there is a bugtracker for Tkinter somewhere. >> I don't even know if Tkinter is still in development, in fact. >> >> Is it? > Tkinter is just a wrapper around Tk. Here is the place to report Tk bugs: > > http://core.tcl.tk/tk/reportlist > From paul at tartan.co.za Tue Feb 17 16:41:36 2015 From: paul at tartan.co.za (Paul Malherbe) Date: Tue, 17 Feb 2015 17:41:36 +0200 Subject: [Tkinter-discuss] Tkinter grid_info() Message-ID: <54E36130.7090600@tartan.co.za> Please could someone tell me why this is not working? from Tkinter import * root = Tk() e = Entry(root) e.grid(column=0, row=0) info = e.grid_info() print "row:", info["row"], "column:", info["column"] root.mainloop() Running this displays the following error: Traceback (most recent call last): File "test.py", line 6, in grid_info = e.grid_info() File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 2000, in grid_info self.tk.call('grid', 'info', self._w)) TypeError: coercing to Unicode: need string or buffer, _tkinter.Tcl_Obj found From inq1ltd at inqvista.com Tue Feb 17 17:55:26 2015 From: inq1ltd at inqvista.com (inq1ltd) Date: Tue, 17 Feb 2015 11:55:26 -0500 Subject: [Tkinter-discuss] Tkinter grid_info() In-Reply-To: <54E36130.7090600@tartan.co.za> References: <54E36130.7090600@tartan.co.za> Message-ID: <33129179.mEyf8pjpfv@mach-123> Paul, Are you trying to create a loop to add entry fields to a form? jimonlinux inq1ltd at inqvista.com On Tuesday, February 17, 2015 05:41:36 PM Paul Malherbe wrote: > Please could someone tell me why this is > not working? > > from Tkinter import * > > root = Tk() > e = Entry(root) > e.grid(column=0, row=0) > info = e.grid_info() > print "row:", info["row"], "column:", > info["column"] root.mainloop() > > Running this displays the following error: > > Traceback (most recent call last): > File "test.py", line 6, in > grid_info = e.grid_info() > File > "/usr/lib/python2.7/lib-tk/Tkinter.py", > line 2000, in grid_info > self.tk.call('grid', 'info', self._w)) > TypeError: coercing to Unicode: need > string or buffer, _tkinter.Tcl_Obj found > ___________________________________________ > ____ Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tk > inter-discuss From paul at tartan.co.za Tue Feb 17 18:28:37 2015 From: paul at tartan.co.za (Paul Malherbe) Date: Tue, 17 Feb 2015 19:28:37 +0200 Subject: [Tkinter-discuss] Tkinter grid_info() In-Reply-To: <33129179.mEyf8pjpfv@mach-123> References: <54E36130.7090600@tartan.co.za> <33129179.mEyf8pjpfv@mach-123> Message-ID: <54E37A45.5070807@tartan.co.za> No I want to store the info detail so that if I later forget the widget I can restore it to the same position using the stored details. Paul On 17/02/2015 18:55, inq1ltd wrote: > Paul, > Are you trying to create a loop to add entry > fields to a form? > > jimonlinux > inq1ltd at inqvista.com > > > > On Tuesday, February 17, 2015 05:41:36 PM > Paul Malherbe wrote: >> Please could someone tell me why this is >> not working? >> >> from Tkinter import * >> >> root = Tk() >> e = Entry(root) >> e.grid(column=0, row=0) >> info = e.grid_info() >> print "row:", info["row"], "column:", >> info["column"] root.mainloop() >> >> Running this displays the following error: >> >> Traceback (most recent call last): >> File "test.py", line 6, in >> grid_info = e.grid_info() >> File >> "/usr/lib/python2.7/lib-tk/Tkinter.py", >> line 2000, in grid_info >> self.tk.call('grid', 'info', self._w)) >> TypeError: coercing to Unicode: need >> string or buffer, _tkinter.Tcl_Obj found >> ___________________________________________ >> ____ Tkinter-discuss mailing list >> Tkinter-discuss at python.org >> https://mail.python.org/mailman/listinfo/tk >> inter-discuss From inq1ltd at inqvista.com Tue Feb 17 21:51:18 2015 From: inq1ltd at inqvista.com (inq1ltd) Date: Tue, 17 Feb 2015 15:51:18 -0500 Subject: [Tkinter-discuss] Tkinter grid_info() In-Reply-To: <54E37A45.5070807@tartan.co.za> References: <54E36130.7090600@tartan.co.za> <33129179.mEyf8pjpfv@mach-123> <54E37A45.5070807@tartan.co.za> Message-ID: <1902323.FRJboa90Y0@mach-123> Paul, Try this link, sounds like the same problem that you have. https://mail.python.org/pipermail/tkinter-discuss/2013-December/003538.html jimonlinux inq1ltd at inqvista.com On Tuesday, February 17, 2015 07:28:37 PM Paul Malherbe wrote: > No > > I want to store the info detail so that if > I later forget the widget I can restore it > to the same position using the stored > details. > > Paul > > On 17/02/2015 18:55, inq1ltd wrote: > > Paul, > > Are you trying to create a loop to add > > entry fields to a form? > > > > jimonlinux > > inq1ltd at inqvista.com > > > > > > > > On Tuesday, February 17, 2015 05:41:36 PM > > > > Paul Malherbe wrote: > >> Please could someone tell me why this is > >> not working? > >> > >> from Tkinter import * > >> > >> root = Tk() > >> e = Entry(root) > >> e.grid(column=0, row=0) > >> info = e.grid_info() > >> print "row:", info["row"], "column:", > >> info["column"] root.mainloop() > >> > >> Running this displays the following > >> error: > >> > >> Traceback (most recent call last): > >> File "test.py", line 6, in > >> > >> grid_info = e.grid_info() > >> > >> File > >> > >> "/usr/lib/python2.7/lib-tk/Tkinter.py", > >> line 2000, in grid_info > >> self.tk.call('grid', 'info', self._w)) > >> TypeError: coercing to Unicode: need > >> string or buffer, _tkinter.Tcl_Obj found > >> ________________________________________ > >> ___ ____ Tkinter-discuss mailing list > >> Tkinter-discuss at python.org > >> https://mail.python.org/mailman/listinfo > >> /tk inter-discuss From jepler at unpythonic.net Tue Feb 17 21:31:35 2015 From: jepler at unpythonic.net (Jeff Epler) Date: Tue, 17 Feb 2015 14:31:35 -0600 Subject: [Tkinter-discuss] Tkinter grid_info() In-Reply-To: <54E36130.7090600@tartan.co.za> References: <54E36130.7090600@tartan.co.za> Message-ID: <20150217203135.GA37960@unpythonic.net> Not reproduced on: Python 2.7.3 (default, Mar 13 2014, 11:03:55) [GCC 4.7.2] on linux2 (Debian Wheezy amd64 with python 2.7.3-6+deb7u2, tcltk 8.5.11-2) $ python /tmp/Malherbe.py row: 0 column: 0 Jeff From paul at tartan.co.za Wed Feb 18 06:51:58 2015 From: paul at tartan.co.za (Paul Malherbe) Date: Wed, 18 Feb 2015 07:51:58 +0200 Subject: [Tkinter-discuss] Tkinter grid_info() In-Reply-To: <1902323.FRJboa90Y0@mach-123> References: <54E36130.7090600@tartan.co.za> <33129179.mEyf8pjpfv@mach-123> <54E37A45.5070807@tartan.co.za> <1902323.FRJboa90Y0@mach-123> Message-ID: <54E4287E.9010509@tartan.co.za> Hi Definitely the same problem and the solution helped. Thanks, Paul Signature On 17/02/2015 22:51, inq1ltd wrote: > Paul, > > Try this link, sounds like the same problem > that you have. > > https://mail.python.org/pipermail/tkinter-discuss/2013-December/003538.html > > > jimonlinux > inq1ltd at inqvista.com > > > > > On Tuesday, February 17, 2015 07:28:37 PM > Paul Malherbe wrote: >> No >> >> I want to store the info detail so that if >> I later forget the widget I can restore it >> to the same position using the stored >> details. >> >> Paul >> >> On 17/02/2015 18:55, inq1ltd wrote: >>> Paul, >>> Are you trying to create a loop to add >>> entry fields to a form? >>> >>> jimonlinux >>> inq1ltd at inqvista.com >>> >>> >>> >>> On Tuesday, February 17, 2015 05:41:36 PM >>> >>> Paul Malherbe wrote: >>>> Please could someone tell me why this is >>>> not working? >>>> >>>> from Tkinter import * >>>> >>>> root = Tk() >>>> e = Entry(root) >>>> e.grid(column=0, row=0) >>>> info = e.grid_info() >>>> print "row:", info["row"], "column:", >>>> info["column"] root.mainloop() >>>> >>>> Running this displays the following >>>> error: >>>> >>>> Traceback (most recent call last): >>>> File "test.py", line 6, in >>>> >>>> grid_info = e.grid_info() >>>> >>>> File >>>> >>>> "/usr/lib/python2.7/lib-tk/Tkinter.py", >>>> line 2000, in grid_info >>>> self.tk.call('grid', 'info', self._w)) >>>> TypeError: coercing to Unicode: need >>>> string or buffer, _tkinter.Tcl_Obj found >>>> ________________________________________ >>>> ___ ____ Tkinter-discuss mailing list >>>> Tkinter-discuss at python.org >>>> https://mail.python.org/mailman/listinfo >>>> /tk inter-discuss From paul at tartan.co.za Wed Feb 18 13:49:14 2015 From: paul at tartan.co.za (Paul Malherbe) Date: Wed, 18 Feb 2015 14:49:14 +0200 Subject: [Tkinter-discuss] Tkinter grid_info() In-Reply-To: <20150217203135.GA37960@unpythonic.net> References: <54E36130.7090600@tartan.co.za> <20150217203135.GA37960@unpythonic.net> Message-ID: <54E48A4A.8020603@tartan.co.za> Hi Jeff The problem seems to have occurred with version 2.7.6 of python in linux. Paul Signature On 17/02/2015 22:31, Jeff Epler wrote: > Not reproduced on: > Python 2.7.3 (default, Mar 13 2014, 11:03:55) > [GCC 4.7.2] on linux2 > (Debian Wheezy amd64 with python 2.7.3-6+deb7u2, tcltk 8.5.11-2) > > $ python /tmp/Malherbe.py > row: 0 column: 0 > > Jeff > From klappnase at web.de Wed Feb 18 18:04:20 2015 From: klappnase at web.de (Michael Lange) Date: Wed, 18 Feb 2015 18:04:20 +0100 Subject: [Tkinter-discuss] Tkinter grid_info() In-Reply-To: <54E48A4A.8020603@tartan.co.za> References: <54E36130.7090600@tartan.co.za> <20150217203135.GA37960@unpythonic.net> <54E48A4A.8020603@tartan.co.za> Message-ID: <20150218180420.ca510c07980ef8471396c5a3@web.de> On Wed, 18 Feb 2015 14:49:14 +0200 Paul Malherbe wrote: > Hi Jeff > > The problem seems to have occurred with version 2.7.6 of python in > linux. I always found it impossible to predict the occurence of these TclObjects, it seems to me that they depend on a combination of Python and Tcl/Tk versions that are not fully compatible, this is why I recommend setting wantobjects to False when writing code that is supposed to work on different systems, with unknown Python/Tk combinations. Btw, I think I read somewhere that wantobjects = False is supposed to work now with recent versions of Python3, too (never tested it myself, though) Regards Michael > > Paul > Signature > On 17/02/2015 22:31, Jeff Epler wrote: > > Not reproduced on: > > Python 2.7.3 (default, Mar 13 2014, 11:03:55) > > [GCC 4.7.2] on linux2 > > (Debian Wheezy amd64 with python 2.7.3-6+deb7u2, tcltk 8.5.11-2) > > > > $ python /tmp/Malherbe.py > > row: 0 column: 0 > > > > Jeff > > > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. Totally illogical, there was no chance. -- Spock, "The Galileo Seven", stardate 2822.3 From paul at tartan.co.za Wed Feb 18 19:52:06 2015 From: paul at tartan.co.za (Paul Malherbe) Date: Wed, 18 Feb 2015 20:52:06 +0200 Subject: [Tkinter-discuss] Tkinter grid_info() In-Reply-To: <20150218180420.ca510c07980ef8471396c5a3@web.de> References: <54E36130.7090600@tartan.co.za> <20150217203135.GA37960@unpythonic.net> <54E48A4A.8020603@tartan.co.za> <20150218180420.ca510c07980ef8471396c5a3@web.de> Message-ID: <54E4DF56.9070507@tartan.co.za> Hi Michael I tried using wantobjects=False but found that it broke too many other things like e.g. cget['size'], cget['width'], Treeview selection and some others. I found that in this case it was easier to create my own geom_info function. Paul On 18/02/2015 19:04, Michael Lange wrote: > On Wed, 18 Feb 2015 14:49:14 +0200 > Paul Malherbe wrote: > >> Hi Jeff >> >> The problem seems to have occurred with version 2.7.6 of python in >> linux. > I always found it impossible to predict the occurence of these > TclObjects, it seems to me that they depend on a combination of Python > and Tcl/Tk versions that are not fully compatible, this is why I > recommend setting wantobjects to False when writing code that is supposed > to work on different systems, with unknown Python/Tk combinations. > > Btw, I think I read somewhere that wantobjects = False is supposed to > work now with recent versions of Python3, too (never tested it myself, > though) > > Regards > > Michael > > >> Paul >> Signature >> On 17/02/2015 22:31, Jeff Epler wrote: >>> Not reproduced on: >>> Python 2.7.3 (default, Mar 13 2014, 11:03:55) >>> [GCC 4.7.2] on linux2 >>> (Debian Wheezy amd64 with python 2.7.3-6+deb7u2, tcltk 8.5.11-2) >>> >>> $ python /tmp/Malherbe.py >>> row: 0 column: 0 >>> >>> Jeff >>> >> _______________________________________________ >> Tkinter-discuss mailing list >> Tkinter-discuss at python.org >> https://mail.python.org/mailman/listinfo/tkinter-discuss > > > .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. > > Totally illogical, there was no chance. > -- Spock, "The Galileo Seven", stardate 2822.3 > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss > From klappnase at web.de Wed Feb 18 21:44:56 2015 From: klappnase at web.de (Michael Lange) Date: Wed, 18 Feb 2015 21:44:56 +0100 Subject: [Tkinter-discuss] Tkinter grid_info() In-Reply-To: <54E4DF56.9070507@tartan.co.za> References: <54E36130.7090600@tartan.co.za> <20150217203135.GA37960@unpythonic.net> <54E48A4A.8020603@tartan.co.za> <20150218180420.ca510c07980ef8471396c5a3@web.de> <54E4DF56.9070507@tartan.co.za> Message-ID: <20150218214456.5d302cf387c514363fd42feb@web.de> Hi Paul, On Wed, 18 Feb 2015 20:52:06 +0200 Paul Malherbe wrote: > Hi Michael > > I tried using wantobjects=False but found that it broke too many other > things like e.g. cget['size'], cget['width'], Treeview selection and > some others. I found that in this case it was easier to create my own > geom_info function. glad to hear that everything works for you now. Of course you are right, changing this in an existing project is likely to cause quite a bunch of side effects. I usually set wantobjects to False right from the start, then it does not add much cost to use calls like int(cget('size')) etc. Maybe "ad hoc" type-conversions as these have an impact on performance in some situations, if really a lot of them have to be done, but I never experienced any problems of that kind. Regards Michael > > Paul > > On 18/02/2015 19:04, Michael Lange wrote: > > On Wed, 18 Feb 2015 14:49:14 +0200 > > Paul Malherbe wrote: > > > >> Hi Jeff > >> > >> The problem seems to have occurred with version 2.7.6 of python in > >> linux. > > I always found it impossible to predict the occurence of these > > TclObjects, it seems to me that they depend on a combination of Python > > and Tcl/Tk versions that are not fully compatible, this is why I > > recommend setting wantobjects to False when writing code that is > > supposed to work on different systems, with unknown Python/Tk > > combinations. > > > > Btw, I think I read somewhere that wantobjects = False is supposed to > > work now with recent versions of Python3, too (never tested it myself, > > though) > > > > Regards > > > > Michael > > > > > >> Paul > >> Signature > >> On 17/02/2015 22:31, Jeff Epler wrote: > >>> Not reproduced on: > >>> Python 2.7.3 (default, Mar 13 2014, 11:03:55) > >>> [GCC 4.7.2] on linux2 > >>> (Debian Wheezy amd64 with python 2.7.3-6+deb7u2, tcltk 8.5.11-2) > >>> > >>> $ python /tmp/Malherbe.py > >>> row: 0 column: 0 > >>> > >>> Jeff > >>> > >> _______________________________________________ > >> Tkinter-discuss mailing list > >> Tkinter-discuss at python.org > >> https://mail.python.org/mailman/listinfo/tkinter-discuss > > > > > > .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. > > --- ... .--. . .-. > > > > Totally illogical, there was no chance. > > -- Spock, "The Galileo Seven", stardate 2822.3 > > _______________________________________________ > > Tkinter-discuss mailing list > > Tkinter-discuss at python.org > > https://mail.python.org/mailman/listinfo/tkinter-discuss > > > .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. One does not thank logic. -- Sarek, "Journey to Babel", stardate 3842.4 From storchaka at gmail.com Thu Feb 19 17:12:32 2015 From: storchaka at gmail.com (Serhiy Storchaka) Date: Thu, 19 Feb 2015 18:12:32 +0200 Subject: [Tkinter-discuss] Tkinter grid_info() In-Reply-To: <54E36130.7090600@tartan.co.za> References: <54E36130.7090600@tartan.co.za> Message-ID: On 17.02.15 17:41, Paul Malherbe wrote: > Running this displays the following error: > > Traceback (most recent call last): > File "test.py", line 6, in > grid_info = e.grid_info() > File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 2000, in grid_info > self.tk.call('grid', 'info', self._w)) > TypeError: coercing to Unicode: need string or buffer, _tkinter.Tcl_Obj > found What are Python and Tk versions? From paul at tartan.co.za Thu Feb 19 17:22:14 2015 From: paul at tartan.co.za (Paul Malherbe) Date: Thu, 19 Feb 2015 18:22:14 +0200 Subject: [Tkinter-discuss] Tkinter grid_info() In-Reply-To: References: <54E36130.7090600@tartan.co.za> Message-ID: <54E60DB6.7020204@tartan.co.za> On 19/02/2015 18:12, Serhiy Storchaka wrote: > On 17.02.15 17:41, Paul Malherbe wrote: >> Running this displays the following error: >> >> Traceback (most recent call last): >> File "test.py", line 6, in >> grid_info = e.grid_info() >> File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 2000, in grid_info >> self.tk.call('grid', 'info', self._w)) >> TypeError: coercing to Unicode: need string or buffer, _tkinter.Tcl_Obj >> found > What are Python and Tk versions? > > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss > Python 2.7.6 Tk 8.6 Paul From rowen at uw.edu Thu Feb 19 21:12:58 2015 From: rowen at uw.edu (Russell Owen) Date: Thu, 19 Feb 2015 12:12:58 -0800 Subject: [Tkinter-discuss] Tkinter grid_info() In-Reply-To: <54E60DB6.7020204@tartan.co.za> References: <54E36130.7090600@tartan.co.za> <54E60DB6.7020204@tartan.co.za> Message-ID: On 2/19/15 8:22 AM, Paul Malherbe wrote: > On 19/02/2015 18:12, Serhiy Storchaka wrote: > >> On 17.02.15 17:41, Paul Malherbe wrote: >>> Running this displays the following error: >>> >>> Traceback (most recent call last): >>> File "test.py", line 6, in >>> grid_info = e.grid_info() >>> File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 2000, in grid_info >>> self.tk.call('grid', 'info', self._w)) >>> TypeError: coercing to Unicode: need string or buffer, _tkinter.Tcl_Obj >>> found >> What are Python and Tk versions? >> >> >> _______________________________________________ >> Tkinter-discuss mailing list >> Tkinter-discuss at python.org >> https://mail.python.org/mailman/listinfo/tkinter-discuss >> > Python 2.7.6 > Tk 8.6 I don't think Python 2.7 is compatible with Tk 8.6. Have you tried 8.5? I thought Python 3 was intended to be used with Tk 8.6 but this page suggests otherwise: -- Russell From nad at acm.org Fri Feb 20 11:03:54 2015 From: nad at acm.org (Ned Deily) Date: Fri, 20 Feb 2015 02:03:54 -0800 Subject: [Tkinter-discuss] Tkinter grid_info() References: <54E36130.7090600@tartan.co.za> <54E60DB6.7020204@tartan.co.za> Message-ID: In article , Russell Owen wrote: > I don't think Python 2.7 is compatible with Tk 8.6. Have you tried 8.5? > > I thought Python 3 was intended to be used with Tk 8.6 but this page > suggests otherwise: > Current versions of Python 2.7.x and 3.4.x are being shipped by various distributors with Tk versions 8.4, 8.5, and/or 8.6. If there's a specific problem with using 8.6, please open an issue at bugs.python.org. -- Ned Deily, nad at acm.org From lilliputian at txtax.com Wed Feb 4 18:28:58 2015 From: lilliputian at txtax.com (Shondra Siskin) Date: Wed, 04 Feb 2015 17:28:58 -0000 Subject: [Tkinter-discuss] corret sa Message-ID: Hi, --------------------------------------------------------------------- CORRET SA Goutte Vignole 69490 St Forgeux Forgeux FRANCE +33 474 18 13 46 -------------- next part -------------- A non-text attachment was scrubbed... Name: tkinter-discuss at python.org.zip Type: application/zip Size: 32791 bytes Desc: not available URL: From kamlendra.chandra32 at gmail.com Tue Feb 24 15:38:08 2015 From: kamlendra.chandra32 at gmail.com (kamal_17) Date: Tue, 24 Feb 2015 06:38:08 -0800 (PST) Subject: [Tkinter-discuss] Redirecting command prompt to a gui realtime Message-ID: <1424788688372-5087377.post@n6.nabble.com> Hi, I want to redirect output of a script into a gui window in realtime. Please share some code snippet where u have encountered similar issue. Thanks, Kamlendra -- View this message in context: http://python.6.x6.nabble.com/Redirecting-command-prompt-to-a-gui-realtime-tp5087377.html Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From kamlendra.chandra32 at gmail.com Tue Feb 24 17:46:52 2015 From: kamlendra.chandra32 at gmail.com (Kamlendra Chandra) Date: Tue, 24 Feb 2015 22:16:52 +0530 Subject: [Tkinter-discuss] Redirecting command prompt to a gui realtime In-Reply-To: <2277231.p9oejCrsH9@mach-123> References: <1424788688372-5087377.post@n6.nabble.com> <2277231.p9oejCrsH9@mach-123> Message-ID: Hi, I want to redirect the console or command line output to a python gui in realtime. But most of the codes i have seen waits for the script to complete than show up in gui. My script is long and it shows is progress while executing, i want a realtime output on gui. Code snippet: *import wxfrom wx.lib.delayedresult import startWorker from subprocess import Popen, PIPEclass MainWindow(wx.Frame): def __init__(self, *args, **kwargs): wx.Frame.__init__(self, *args, **kwargs) self.panel = wx.Panel(self) self.button = wx.Button(self.panel, label="Run!") self.command = wx.TextCtrl(self.panel) self.result = wx.TextCtrl(self.panel, style=wx.TE_MULTILINE) self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.command, 0, wx.EXPAND) self.sizer.Add(self.button, 0, wx.EXPAND) self.sizer.Add(self.result, 1, wx.EXPAND) self.command.SetValue("dir") self.button.Bind(wx.EVT_BUTTON, self.CallCommand) self.panel.SetSizerAndFit(self.sizer) self.Show() def CallCommand(self, e): startWorker(self.WorkCommandDone, self.WorkCommand) def WorkCommand(self): self.button.Disable() p = Popen(self.command.GetValue(), shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) while True: line = p.stdout.readline() if line != '': wx.CallAfter(self.result.AppendText, line) else: break def WorkCommandDone(self, result): self.button.Enable()app = wx.App(False)win = MainWindow(None)app.MainLoop()* help me to modify to this code to suit my requirement, or suggest me any other way, Thanks, kamlendra On Tue, Feb 24, 2015 at 10:07 PM, inq1ltd wrote: > Kamlendra, > > Please explain in more detail what you are > trying to accomplish. > > jimonlinux, > inqvista.com > > > > > On Tuesday, February 24, 2015 06:38:08 AM > kamal_17 wrote: > > Hi, > > > > I want to redirect output of a script into > > a gui window in realtime. > > > > Please share some code snippet where u have > > encountered similar issue. > > > > Thanks, > > Kamlendra > > > > > > > > -- > > View this message in context: > > http://python.6.x6.nabble.com/Redirecting-> > command-prompt-to-a-gui-realtime-tp5087377. > > html Sent from the Python - tkinter-discuss > > mailing list archive at Nabble.com. > > __________________________________________ > > _____ Tkinter-discuss mailing list > > Tkinter-discuss at python.org > > https://mail.python.org/mailman/listinfo/tk > > inter-discuss > -------------- next part -------------- An HTML attachment was scrubbed... URL: From inq1ltd at inqvista.com Tue Feb 24 17:30:27 2015 From: inq1ltd at inqvista.com (inq1ltd) Date: Tue, 24 Feb 2015 11:30:27 -0500 Subject: [Tkinter-discuss] corret sa In-Reply-To: References: Message-ID: <1796146.QaDEKCeHUn@mach-123> Please send text question, many people will not open a zip file. jimonlinux inq1ltd at inqvista.com On Wednesday, February 04, 2015 06:13:40 PM Shondra Siskin wrote: > Hi, > > ------------------------------------------- > -------------------------- CORRET SA > Goutte Vignole 69490 St Forgeux > Forgeux > FRANCE > +33 474 18 13 46 From inq1ltd at inqvista.com Tue Feb 24 17:37:20 2015 From: inq1ltd at inqvista.com (inq1ltd) Date: Tue, 24 Feb 2015 11:37:20 -0500 Subject: [Tkinter-discuss] Redirecting command prompt to a gui realtime In-Reply-To: <1424788688372-5087377.post@n6.nabble.com> References: <1424788688372-5087377.post@n6.nabble.com> Message-ID: <2277231.p9oejCrsH9@mach-123> Kamlendra, Please explain in more detail what you are trying to accomplish. jimonlinux, inqvista.com On Tuesday, February 24, 2015 06:38:08 AM kamal_17 wrote: > Hi, > > I want to redirect output of a script into > a gui window in realtime. > > Please share some code snippet where u have > encountered similar issue. > > Thanks, > Kamlendra > > > > -- > View this message in context: > http://python.6.x6.nabble.com/Redirecting-> command-prompt-to-a-gui-realtime-tp5087377. > html Sent from the Python - tkinter-discuss > mailing list archive at Nabble.com. > __________________________________________ > _____ Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tk > inter-discuss From mid.tier at gmail.com Tue Feb 24 20:52:48 2015 From: mid.tier at gmail.com (mid.tier) Date: Wed, 25 Feb 2015 01:52:48 +0600 Subject: [Tkinter-discuss] Redirecting command prompt to a gui realtime In-Reply-To: References: <1424788688372-5087377.post@n6.nabble.com> <2277231.p9oejCrsH9@mach-123> Message-ID: Hi, Look at this package - pytkapp. See demo script in this package - /demo/run_ptamdidemo.py, after start - select ThreadChild btn from toolbar (button with lighting) 2015-02-24 22:46 GMT+06:00, Kamlendra Chandra : > Hi, > > I want to redirect the console or command line output to a python gui in > realtime. > > But most of the codes i have seen waits for the script to complete than > show up in gui. > > My script is long and it shows is progress while executing, i want a > realtime output on gui. > > Code snippet: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > *import wxfrom wx.lib.delayedresult import startWorker from subprocess > import Popen, PIPEclass MainWindow(wx.Frame): def __init__(self, *args, > **kwargs): wx.Frame.__init__(self, *args, **kwargs) > self.panel = wx.Panel(self) self.button = wx.Button(self.panel, > label="Run!") self.command = wx.TextCtrl(self.panel) > self.result = wx.TextCtrl(self.panel, style=wx.TE_MULTILINE) > self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.command, > 0, wx.EXPAND) self.sizer.Add(self.button, 0, wx.EXPAND) > self.sizer.Add(self.result, 1, wx.EXPAND) > self.command.SetValue("dir") self.button.Bind(wx.EVT_BUTTON, > self.CallCommand) self.panel.SetSizerAndFit(self.sizer) > self.Show() def CallCommand(self, e): > startWorker(self.WorkCommandDone, self.WorkCommand) def > WorkCommand(self): self.button.Disable() p = > Popen(self.command.GetValue(), shell=True, stdin=PIPE, > stdout=PIPE, stderr=PIPE) while True: line = > p.stdout.readline() if line != '': > wx.CallAfter(self.result.AppendText, line) else: > break def WorkCommandDone(self, result): self.button.Enable()app > = wx.App(False)win = MainWindow(None)app.MainLoop()* > help me to modify to this code to suit my requirement, or suggest me any > other way, > > Thanks, > kamlendra > > On Tue, Feb 24, 2015 at 10:07 PM, inq1ltd wrote: > >> Kamlendra, >> >> Please explain in more detail what you are >> trying to accomplish. >> >> jimonlinux, >> inqvista.com >> >> >> >> >> On Tuesday, February 24, 2015 06:38:08 AM >> kamal_17 wrote: >> > Hi, >> > >> > I want to redirect output of a script into >> > a gui window in realtime. >> > >> > Please share some code snippet where u have >> > encountered similar issue. >> > >> > Thanks, >> > Kamlendra >> > >> > >> > >> > -- >> > View this message in context: >> > http://python.6.x6.nabble.com/Redirecting-> >> command-prompt-to-a-gui-realtime-tp5087377. >> > html Sent from the Python - tkinter-discuss >> > mailing list archive at Nabble.com. >> > __________________________________________ >> > _____ Tkinter-discuss mailing list >> > Tkinter-discuss at python.org >> > https://mail.python.org/mailman/listinfo/tk >> > inter-discuss >> > From Cameron at phaseit.net Tue Feb 24 18:07:57 2015 From: Cameron at phaseit.net (Cameron Laird) Date: Tue, 24 Feb 2015 17:07:57 +0000 Subject: [Tkinter-discuss] Redirecting command prompt to a gui realtime In-Reply-To: References: <1424788688372-5087377.post@n6.nabble.com> <2277231.p9oejCrsH9@mach-123> Message-ID: <20150224170757.GA22754@lairds.us> On Tue, Feb 24, 2015 at 10:16:52PM +0530, Kamlendra Chandra wrote: . . . > I want to redirect the console or command line output to a python gui in > realtime. > > But most of the codes i have seen waits for the script to complete than > show up in gui. > > My script is long and it shows is progress while executing, i want a > realtime output on gui. . . . Perfectly sensible. Do you see how to apply and its references?