From bryan.oakley at gmail.com Mon Jan 1 08:33:07 2018 From: bryan.oakley at gmail.com (Bryan Oakley) Date: Mon, 1 Jan 2018 07:33:07 -0600 Subject: [Tkinter-discuss] why from _tkinter import * ? why the underscore In-Reply-To: References: Message-ID: _tkinter is the internal name of the C-based wrapper around the tcl interpreter. It has a leading underscore to highlight the fact that it's a "private" method that is part of the tkinter package. On Sat, Dec 30, 2017 at 7:50 PM, R wrote: > > why from _tkinter import * ? > > > > why the underscore in _tkinter ? > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rrr at onionmail.info Mon Jan 1 08:41:00 2018 From: rrr at onionmail.info (R) Date: Mon, 01 Jan 2018 13:41:00 +0000 Subject: [Tkinter-discuss] why from _tkinter import * ? why the underscore In-Reply-To: References: Message-ID: adil gourinda: > where have you seen that example? > ________________________________ > From: Tkinter-discuss on behalf of R A valid question. It straight from the main wiki : https://wiki.python.org/moin/TkInter , the head honcho of authoritative web sources. "Checking your Tkinter support A good way to systematically check whether your Tkinter support is working is the following. Enter an interactive Python interpreter in a shell on an X console. Step 1 - can _tkinter be imported? Try the following command at the Python prompt: >>> import _tkinter # with underscore, and lowercase 't' If it works, go to step 2. [...] " From rrr at onionmail.info Mon Jan 1 08:42:00 2018 From: rrr at onionmail.info (R) Date: Mon, 01 Jan 2018 13:42:00 +0000 Subject: [Tkinter-discuss] why from _tkinter import * ? why the underscore In-Reply-To: References: Message-ID: Bryan Oakley: > _tkinter is the internal name of the C-based wrapper around the tcl > interpreter. It has a leading underscore to highlight the fact that it's a > "private" method that is part of the tkinter package. Ah , thanks ! I've put that into the app to clarify. Happy New Year, everyone ! From rikudou__sennin at live.com Mon Jan 1 11:59:34 2018 From: rikudou__sennin at live.com (adil gourinda) Date: Mon, 1 Jan 2018 16:59:34 +0000 Subject: [Tkinter-discuss] Contribution to Tkinter's Documentation In-Reply-To: References: , Message-ID: I)Installation's problem: ======================= I don't know on which platform you are working on it, but: -if you are working on windows, it is better to download python from their officiel website: https://www.python.org/downloads/release/python-364/ -if you are working on linux, Python is preinstalled by default on the majority of disributions. II) Syntax's problem: ===================== If the installation is well done, then the problem may be your code's example, share it so the community can help you. I am a simple Tkinter's user like you ________________________________ From: Tkinter-discuss on behalf of R Sent: Monday, January 1, 2018 1:46 AM To: tkinter-discuss at python.org Subject: Re: [Tkinter-discuss] Contribution to Tkinter's Documentation adil gourinda: > which parts of Tkinter you find difficult to understand ? well I kinda struggle with setup tools and such things. usually it all breaks down before I can even launch a tk app. _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org https://mail.python.org/mailman/listinfo/tkinter-discuss -------------- next part -------------- An HTML attachment was scrubbed... URL: From rrr at onionmail.info Tue Jan 2 13:08:00 2018 From: rrr at onionmail.info (R) Date: Tue, 02 Jan 2018 18:08:00 +0000 Subject: [Tkinter-discuss] Contribution to Tkinter's Documentation In-Reply-To: References: Message-ID: alright Adil, I'll keep you posted! From rikudou__sennin at outlook.com Wed Jan 3 16:42:47 2018 From: rikudou__sennin at outlook.com (adil gourinda) Date: Wed, 3 Jan 2018 21:42:47 +0000 Subject: [Tkinter-discuss] Mapping Tcl's arguments to Python's arguments Message-ID: Please can someone illuminate the differences between Tcl's arguments and Python's arguments? After reading a little about tcl/Tk I found that the arguments are written in the forms: 1) -option (the option's name alone is an argument) 2) -option value (with description of value's type) 3) value (only the value's description exists, no "-option") 4) ?expression? Python opponents: 1) option=Boolean_Value 2) "*,option=value", keyword-only argument (but value is the default argument, not its nature) 3) is positional argument and the value's name is passed to option's name. 4) can you explain the difference between function(option1=value [,option2]) *2)+3) are grouped in positional-keyword argument -------------- next part -------------- An HTML attachment was scrubbed... URL: From bryan.oakley at gmail.com Thu Jan 4 10:12:02 2018 From: bryan.oakley at gmail.com (Bryan Oakley) Date: Thu, 4 Jan 2018 09:12:02 -0600 Subject: [Tkinter-discuss] Mapping Tcl's arguments to Python's arguments In-Reply-To: References: Message-ID: You cannot generalize tcl arguments. The tcl syntax is exceptionally simple: every statement starts with a command, and every "word" after that is an argument. A "word" can be just that - a single word, or a collection of characters inside quotes. It is up to each individual command as to how it interprets arguments. Tcl commands tend to use optional arguments that begin with a dash like a python keyword argument (eg: -background blue / background="blue") but this isn't always the case. There's nothing enforced by the language to require that options begin with "-", and the tcl language doesn't require that positional arguments and keyword arguments come in any particular order or that options must be followed by a value. In the context of tk and tkinter, widget options typically begin with "-" in tcl/tk, and are treated as keyword arguments in python/tkinter (eg: -background blue / background="blue"). On Wed, Jan 3, 2018 at 3:42 PM, adil gourinda wrote: > Please can someone illuminate the differences between Tcl's arguments and > Python's arguments? > > After reading a little about tcl/Tk I found that the arguments are written > in the forms: > 1) -option (the option's name alone is an argument) > 2) -option value (with description of value's type) > 3) value (only the value's description exists, no "-option") > 4) ?expression? > > Python opponents: > 1) option=Boolean_Value > 2) "*,option=value", keyword-only argument (but value is the default > argument, not its nature) > 3) is positional argument and the value's name is passed to option's name. > 4) can you explain the difference between function(option1=value > [,option2]) > > *2)+3) are grouped in positional-keyword argument > > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > https://mail.python.org/mailman/listinfo/tkinter-discuss > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alan.gauld at yahoo.co.uk Fri Jan 5 07:12:27 2018 From: alan.gauld at yahoo.co.uk (Alan Gauld) Date: Fri, 5 Jan 2018 12:12:27 +0000 Subject: [Tkinter-discuss] TKinter and Python asyncio In-Reply-To: <3z1ZCh5l3Sz9rxG@submission02.posteo.de> References: <3z0KFr6Wpjz9rxM@submission02.posteo.de> <3z0srL2JyYz9rxQ@submission02.posteo.de> <3z1XS23SZ1z9rxR@submission02.posteo.de> <20171220002301.e8775e06730d6ccdff2ea227@web.de> <3z1ZCh5l3Sz9rxG@submission02.posteo.de> Message-ID: On 19/12/17 23:40, c.buhtz at posteo.jp wrote: > I need to download between 100 or 200 xml-like files from different > locations. More specific: I use "feedparser" to get rss/atom feeds. > The issue is probably not how many files you need but how many sites you need. If it is 1 file per site I'd definitely go with asyncio (and added complexity) but if its only a few sites(3 or 4 say?) then a thread per site might suffice and be simpler. You could of course just use one thread and process all sites in turn from there if your desired polling interval is not too short. In other words if all you want to do is stop the GUI from blocking a single thread is all you need and by far the simplest option. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos From lemartl2015 at nauta.cu Wed Jan 17 23:31:54 2018 From: lemartl2015 at nauta.cu (Lemar Hurtado) Date: Wed, 17 Jan 2018 23:31:54 -0500 Subject: [Tkinter-discuss] Draw a table in Python 3.1 Message-ID: I ran your code, and it works great, I have a similar one that works too, but I just need it to not only keep visible the header (first row) when scrolling Y, but to keep the first column visible when scrolling X. From my point of view is near to imposible cause the only way would be to (hypothetically) link the xview of the data and first column canvases to the self.scrollX as well as the y view of the data and the first row canvases to self.scrollY Greetings from Havana? Enviado desde mi BLU Android Smartphone -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemartl2015 at nauta.cu Wed Jan 17 23:24:46 2018 From: lemartl2015 at nauta.cu (Lemar Hurtado) Date: Wed, 17 Jan 2018 23:24:46 -0500 Subject: [Tkinter-discuss] Hi, could you help me?, please Message-ID: <3m99q4morcmry32tgeuogkft.1516248640440@email.android.com> I ran your code, and it works great, I have a similar one that works too, but I just need it to not only keep visible the header (first row) when scrolling Y, but to keep the first column visible when scrolling X. From my point of view is near to imposible cause the only way would be to (hypothetically) link the xview of the data and first column canvases to the self.scrollX as well as the y view of the data and the first row canvases to self.scrollY Greetings from Havana Enviado desde mi BLU Android Smartphone -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at alandmoore.com Wed Jan 31 13:09:15 2018 From: me at alandmoore.com (alan moore) Date: Wed, 31 Jan 2018 12:09:15 -0600 Subject: [Tkinter-discuss] Simulating keystrokes in a tkinter unit test Message-ID: <808e0a5f-f96e-d482-2311-9682f56eaf90@alandmoore.com> Hi all, I'm attempting to write a unit test for a custom widget using Python unittest.? I'm trying to simulate actual keystrokes in my unit test. Following the example from the tkinter test suite, I created a test that is approximately this: from tkinter import Entry as MyWidget from tkinter.test.support import AbstractTkTest import unittest class TestMyWidget(AbstractTkTest, unittest.TestCase): ??? def setUp(self): ??????? super().setUp() ??????? self.mywidget = self.create() ??????? self.mywidget.wait_visibility() ??? def tearDown(self): ??????? super().tearDown() ??????? self.mywidget.destroy() ??? def create(self): ??????? mw = MyWidget(self.root) ??????? mw.pack() ??????? return mw ??? def _keystroke(self, char): self.mywidget.event_generate(''.format(char)) self.mywidget.event_generate(''.format(char)) ??????? self.mywidget.update_idletasks() ??? def test_key_entry(self): ??????? self._keystroke('a') ??????? self.assertEqual(self.mywidget.get(), 'a') if __name__ == '__main__': ??? unittest.main() This doesn't work, though.? The keypresses don't register and create any text in the entry.? I can add text using event_generate inside a mainloop, but without mainloop it doesn't seem to work. Interestingly, I can use the same method to generate mouse events and they seem to be recognized.? Is there a way to make keypresses work without mainloop?