Re: [Tutor] Tkinter: Can's figure out how to put a frame in a second window

2019-03-09 Thread Chris Roy-Smith
On 9/3/19 10:13 pm, Alan Gauld via Tutor wrote: On 09/03/2019 02:53, Chris Roy-Smith wrote: What is happening is that the contents of the frame appear in the master window. I was expecting them to show in the second window. Also I expected the frame to be sunken, but there is no obvious signs o

Re: [Tutor] Tkinter: Can's figure out how to put a frame in a second window

2019-03-09 Thread Alan Gauld via Tutor
On 09/03/2019 02:53, Chris Roy-Smith wrote: > What is happening is that the contents of the frame appear in the master > window. I was expecting them to show in the second window. Also I > expected the frame to be sunken, but there is no obvious signs of the > frame, not even a colored backgrou

[Tutor] Tkinter: Can's figure out how to put a frame in a second window

2019-03-09 Thread Chris Roy-Smith
Hi. running Linux, with python3.6 I am trying to learn how to put a frame on a second window. I get no errors showing in the terminal, and I get no traceback. What is happening is that the contents of the frame appear in the master window. I was expecting them to show in the second window. A

Re: [Tutor] tkinter

2018-09-30 Thread Mark Lawrence
On 30/09/18 08:47, Alan Gauld via Tutor wrote: On 30/09/18 02:22, Jorge Herrera wrote: Hello, I'm new to Python and I've been having a frustrating time with python because I'm trying to import tkinter and it's saying that tkinter is not defined, that it doesn't exist That suggests that Tkinter

Re: [Tutor] tkinter

2018-09-30 Thread Alan Gauld via Tutor
On 30/09/18 02:22, Jorge Herrera wrote: > Hello, I'm new to Python and I've been having a frustrating time with > python because I'm trying to import tkinter and it's saying that tkinter is > not defined, that it doesn't exist That suggests that Tkinter is not installed on your system. What OS ar

[Tutor] tkinter

2018-09-30 Thread Jorge Herrera
Hello, I'm new to Python and I've been having a frustrating time with python because I'm trying to import tkinter and it's saying that tkinter is not defined, that it doesn't exist and now i'm not able to run some of my programs since it states that there is no module named tkinter. If you could he

Re: [Tutor] Tkinter widget (label) updated by TCP/IP message

2018-05-28 Thread Alejandro Chirife via Tutor
Hi Alan, Thank you very much for your help.   I will start working on ti.  There's a lot to chew on here :) Two questions:  1. Got it that nothing to do when mainloop() gets called.  How do you send an event of data arriving when the events for tkinter are all about user interaction? 2. You men

Re: [Tutor] Tkinter widget (label) updated by TCP/IP message

2018-05-28 Thread Mats Wichmann
On 05/28/2018 12:56 PM, Alejandro Chirife via Tutor wrote: > Hi Alan, > Thank you very much for your help.   I will start working on ti.  There's a > lot to chew on here :) > Two questions:  > 1. Got it that nothing to do when mainloop() gets called.  How do you send an > event of data arriving

Re: [Tutor] Tkinter widget (label) updated by TCP/IP message

2018-05-28 Thread Alan Gauld via Tutor
On 28/05/18 19:56, Alejandro Chirife via Tutor wrote: > Two questions:  > 1. ...  How do you send an event of data arriving > when the events for tkinter are all about user interaction? The easiest way is to set a global variable and use a timer event (after()) to poll the variable periodically a

Re: [Tutor] Tkinter widget (label) updated by TCP/IP message

2018-05-27 Thread Alan Gauld via Tutor
On 27/05/18 16:18, Alejandro Chirife via Tutor wrote: > > Hi all, I am having a hard time to create what at first looked like a simple > program with Python 3 and Tkinter: > The UI consist of a window with a label and a button.   > The label shows "waiting for a message" and the button shows "res

[Tutor] Tkinter widget (label) updated by TCP/IP message

2018-05-27 Thread Alejandro Chirife via Tutor
Hi all, I am having a hard time to create what at first looked like a simple program with Python 3 and Tkinter: The UI consist of a window with a label and a button.   The label shows "waiting for a message" and the button shows "reset display".   The handler for the button click just resets the

Re: [Tutor] tkinter code executes before function returned

2018-04-16 Thread Chris Roy-Smith
On 15/04/18 18:10, Alan Gauld via Tutor wrote: On 15/04/18 03:57, Chris Roy-Smith wrote: I am trying to get tkinter to return a number from a window, which then sets how many times to print a sign. I don;t jhave time to look at this in detail just now, maybe later. But first impressions is th

Re: [Tutor] tkinter code executes before function returned

2018-04-15 Thread Mats Wichmann
On 04/15/2018 03:13 PM, Chris Roy-Smith wrote: > On 15/04/18 23:36, Alan Gauld via Tutor wrote: >> On 15/04/18 14:24, Alan Gauld via Tutor wrote: >> >>> OK, I've had a closet look now and can confirm the >> A closer look! Not a closet look. Ooops! :-/ >> >> > Thank you Alan, I have even more to lea

Re: [Tutor] tkinter code executes before function returned

2018-04-15 Thread Chris Roy-Smith
On 15/04/18 23:36, Alan Gauld via Tutor wrote: On 15/04/18 14:24, Alan Gauld via Tutor wrote: OK, I've had a closet look now and can confirm the A closer look! Not a closet look. Ooops! :-/ Thank you Alan, I have even more to learn than I thought. I have been bashing away at several OOP tut

Re: [Tutor] tkinter code executes before function returned

2018-04-15 Thread Alan Gauld via Tutor
On 15/04/18 14:24, Alan Gauld via Tutor wrote: > OK, I've had a closet look now and can confirm the A closer look! Not a closet look. Ooops! :-/ -- 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:

Re: [Tutor] tkinter code executes before function returned

2018-04-15 Thread Alan Gauld via Tutor
On 15/04/18 03:57, Chris Roy-Smith wrote: > The code does not wait till the function returns a value, OK, I've had a closet look now and can confirm the problem lies in your code structure. Its not event based. You need to understand event-driven programming better. In event driven code you ini

Re: [Tutor] tkinter code executes before function returned

2018-04-15 Thread Alan Gauld via Tutor
On 15/04/18 03:57, Chris Roy-Smith wrote: > I am trying to get tkinter to return a number from a window, which then > sets how many times to print a sign. I don;t jhave time to look at this in detail just now, maybe later. But first impressions is that you have a very unorthodox style of Tkinte

[Tutor] tkinter code executes before function returned

2018-04-15 Thread Chris Roy-Smith
Hi, System: Python 3.6, Ubuntu Linux 17.10 I am trying to get tkinter to return a number from a window, which then sets how many times to print a sign. The code does not wait till the function returns a value, resulting in the signcount variable in having a None value, giving an output like

Re: [Tutor] tkinter actively maintained?

2017-06-12 Thread Alan Gauld via Tutor
On 12/06/17 03:54, Michael C wrote: > Hi all: > > is tkinter still being actively maintained? I only had to ask about this > because I have never looked stuff like this up before. Yes, Tkinter tracks the Tk releases so that most of the activity at present is in the ttk sub package. There is a mo

[Tutor] tkinter actively maintained?

2017-06-12 Thread Michael C
Hi all: is tkinter still being actively maintained? I only had to ask about this because I have never looked stuff like this up before. Is it ok to develop using it, is it going to be dropped in the near future? thanks! ___ Tutor maillist - Tutor@pyt

Re: [Tutor] Tkinter + frame + grid question

2017-05-15 Thread Phil
On Mon, 15 May 2017 16:14:48 +0200 Peter Otten <__pete...@web.de> wrote: Thank you Peter, Alan and Abdur-Rahmaan for your replies. After a night's sleep I'm now well on the way to beautifying a Lotto checking program that I wrote a couple of years ago. The need for and the use of frames is now

Re: [Tutor] Tkinter + frame + grid question

2017-05-15 Thread Abdur-Rahmaan Janhangeer
Hum i understand your frustration. however, whatever you use it is ok, just don't mix them at the same time. either use grid or use pack or use place grid is best for me else try some tricks here and there like try adding transparent images in the grid manager use PIL module by specifying

Re: [Tutor] Tkinter + frame + grid question

2017-05-15 Thread Alan Gauld via Tutor
On 15/05/17 07:11, Phil wrote: > I'd like to place a red frame in the centre of the main window. What do you want surrounding it? You are going to have to use whichever layout manager fits the scenario. Remember you can use different layout managers in each frame in your app - and you will usuall

Re: [Tutor] Tkinter + frame + grid question

2017-05-15 Thread Peter Otten
Phil wrote: > Thank you for reading this. > > I'd like to place a red frame in the centre of the main window. > > I've discovered two ways to achieve this using place() and pack(padx, > pady). Grid() does not give the desired result. > > Next I'd like to place some widgets on the frame. Again p

[Tutor] Tkinter + frame + grid question

2017-05-15 Thread Phil
Thank you for reading this. I'd like to place a red frame in the centre of the main window. I've discovered two ways to achieve this using place() and pack(padx, pady). Grid() does not give the desired result. Next I'd like to place some widgets on the frame. Again place() does what I want and

Re: [Tutor] Tkinter layout question

2017-04-30 Thread Alan Gauld via Tutor
On 26/04/17 07:56, Phil wrote: >> Your messages come into the moderation queue, I'm > > Thanks Alan, maybe the reason ...is because I'm > on the bounces list. I don;t know what bounces list you mean but it looks like your messages are going through directly now, I don't know what changed... Po

Re: [Tutor] Tkinter layout question

2017-04-26 Thread Phil
On Tue, 25 Apr 2017 23:27:05 +0100 Alan Gauld via Tutor wrote: > Your messages come into the moderation queue, I'm > not sure why because the moderation flag is not > set on your account(it is automatically for new > members). > > I'll have a closer look next eek when I get back. Thanks Alan,

Re: [Tutor] Tkinter layout question

2017-04-25 Thread Alan Gauld via Tutor
On 24/04/17 23:40, Phil wrote: By the way, I notice that my messages to this list, > and not other's, can take up to four hours Your messages come into the moderation queue, I'm not sure why because the moderation flag is not set on your account(it is automatically for new members). I'll have

Re: [Tutor] Tkinter layout question

2017-04-24 Thread Phil
On Mon, 24 Apr 2017 20:02:32 +0100 Alan Gauld via Tutor wrote: > On 24/04/17 01:50, Phil wrote: > > On Mon, 24 Apr 2017 09:24:55 +1000 > > Phil wrote: > > > >> On Sun, 23 Apr 2017 09:39:54 +0200 > >> Sibylle Koczian wrote: > >> > >>> Am 20.04.2017 um 14:43 schrieb Alan Gauld via Tutor: > I

Re: [Tutor] Tkinter layout question

2017-04-24 Thread Alan Gauld via Tutor
On 24/04/17 20:02, Alan Gauld via Tutor wrote: And you could wrap that up as a pair of get/set functions if you so wished. def get_sudoku_grid(x,y): # code above return item def set_sudoku_grid(x,y,value): #code above item = value I should point out that to use my table code f

Re: [Tutor] Tkinter layout question

2017-04-24 Thread Alan Gauld via Tutor
On 24/04/17 01:50, Phil wrote: On Mon, 24 Apr 2017 09:24:55 +1000 Phil wrote: On Sun, 23 Apr 2017 09:39:54 +0200 Sibylle Koczian wrote: Am 20.04.2017 um 14:43 schrieb Alan Gauld via Tutor: Its not too bad you can map the large 9x9 table to the smaller units using divmod() So the 7th eleme

Re: [Tutor] Tkinter layout question

2017-04-24 Thread Phil
On Sun, 23 Apr 2017 11:28:51 +0200 Peter Otten <__pete...@web.de> wrote: > Consider the function make_a_cake(). If you use it > > eat_a_piece_of(make_a_cake()) > eat_a_piece_of(make_a_cake()) > > that's short for > > one_cake = make_a_cake() > eat_a_piece_of(one_cake) > > another_cake = make_a

Re: [Tutor] Tkinter layout question

2017-04-23 Thread Phil
On Mon, 24 Apr 2017 09:24:55 +1000 Phil wrote: > On Sun, 23 Apr 2017 09:39:54 +0200 > Sibylle Koczian wrote: > > > Am 20.04.2017 um 14:43 schrieb Alan Gauld via Tutor: > > > Its not too bad you can map the large 9x9 table to the smaller > > > units using divmod() > > > > > > So the 7th element

Re: [Tutor] Tkinter layout question

2017-04-23 Thread Phil
On Sun, 23 Apr 2017 09:39:54 +0200 Sibylle Koczian wrote: > Am 20.04.2017 um 14:43 schrieb Alan Gauld via Tutor: > > Its not too bad you can map the large 9x9 table to the smaller units > > using divmod() > > > > So the 7th element becomes > > divmod(7) -> 2,1 > > > > Should be divmod(7, 3), sho

Re: [Tutor] Tkinter layout question

2017-04-23 Thread Peter Otten
Phil wrote: > On Sun, 23 Apr 2017 09:52:16 +0200 > Peter Otten <__pete...@web.de> wrote: > >> If you wrote the above with Buttons instead of DisplayTables you'd >> encounter the same behaviour. The problem is that you call >> tkinter.Tk() twice (which is generally a recipe for disaster; if you >>

Re: [Tutor] Tkinter layout question

2017-04-23 Thread Phil
On Sun, 23 Apr 2017 09:52:16 +0200 Peter Otten <__pete...@web.de> wrote: > If you wrote the above with Buttons instead of DisplayTables you'd > encounter the same behaviour. The problem is that you call > tkinter.Tk() twice (which is generally a recipe for disaster; if you > want multiple windows

Re: [Tutor] Tkinter layout question

2017-04-23 Thread Peter Otten
Phil wrote: > On Thu, 20 Apr 2017 13:43:07 +0100 > Alan Gauld via Tutor wrote: > >> If still confused drop a question here. > > I hope I'm not over doing the questions here. I'm only posting after hours > of experimenting and Internet searching. > > How do I create multiple instances of the ta

Re: [Tutor] Tkinter layout question

2017-04-23 Thread Sibylle Koczian
Am 20.04.2017 um 14:43 schrieb Alan Gauld via Tutor: Its not too bad you can map the large 9x9 table to the smaller units using divmod() So the 7th element becomes divmod(7) -> 2,1 Should be divmod(7, 3), shouldn't it? ___ Tutor maillist - Tuto

Re: [Tutor] Tkinter layout question

2017-04-22 Thread Phil
On Thu, 20 Apr 2017 13:43:07 +0100 Alan Gauld via Tutor wrote: > If still confused drop a question here. I hope I'm not over doing the questions here. I'm only posting after hours of experimenting and Internet searching. How do I create multiple instances of the table on the one frame? I think

Re: [Tutor] Tkinter layout question

2017-04-22 Thread Phil
On Sat, 22 Apr 2017 10:37:19 +0200 Peter Otten <__pete...@web.de> wrote: > That's unnecessary. The code protected by 'if __name__ == "__main__"' > is not executed when the module is imported. In fact that's the very > purpose of this idiom. > > "Best practice" is to avoid star imports which bind

Re: [Tutor] Tkinter layout question

2017-04-22 Thread Peter Otten
Phil wrote: > On Thu, 20 Apr 2017 13:43:07 +0100 > Alan Gauld via Tutor wrote: > >> If still confused drop a question here. > > Maybe not totally confused, more a question of best practice. > > Using your example table class, I commented out all from, and including, > "if __name__ == "__main__

Re: [Tutor] Tkinter layout question

2017-04-21 Thread Phil
On Thu, 20 Apr 2017 13:43:07 +0100 Alan Gauld via Tutor wrote: > If still confused drop a question here. Maybe not totally confused, more a question of best practice. Using your example table class, I commented out all from, and including, "if __name__ == "__main__":" down and saved the file a

Re: [Tutor] Tkinter layout question

2017-04-20 Thread Alan Gauld via Tutor
On 20/04/17 13:43, Alan Gauld via Tutor wrote: > So the 7th element becomes > divmod(7) -> 2,1 > > ie. element 7 maps to the 2nd cell, element 1 That should of course be the 3rd cell (0 based), oops. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.

Re: [Tutor] Tkinter layout question

2017-04-20 Thread Alan Gauld via Tutor
On 20/04/17 10:33, Phil wrote: >> So, for a Suduko grid put 3x3 Entry boxes into a Frame. >> Then put 3x3 such frames into another frame. > > OK, so I'll go back to my original idea and use edit boxes. A grid of 9 x 9 > edit boxes does actually work and it makes it easy to keep track of the > d

Re: [Tutor] Tkinter layout question

2017-04-20 Thread Phil
On Thu, 20 Apr 2017 09:27:27 +0100 Alan Gauld via Tutor wrote: > Eek! that's a recipe for premature baldness! Baldness is not a problem, however, slowing the onset of dementia is the aim of this project. > So, for a Suduko grid put 3x3 Entry boxes into a Frame. > Then put 3x3 such frames into

Re: [Tutor] Tkinter layout question

2017-04-20 Thread Alan Gauld via Tutor
On 19/04/17 23:48, Phil wrote: > I created a 9 x 9 grid on a canvas which looks much better. > I can display digits in the centre of the squares but > entering the digits from the keyboard seems to be beyond me. Eek! that's a recipe for premature baldness! Canvas is designed to display things no

Re: [Tutor] Tkinter layout question

2017-04-20 Thread Palm Tree
for entering digits on the canva i think better create a sort of sudoku generator and display it on the canva in a create_text object. On 20 Apr 2017 05:24, "Phil" wrote: > I'm looking for ideas here. > > A working solution for my sudoku solver is a 9 x 9 grid of entry boxes but > it looks a bit

Re: [Tutor] Tkinter layout question - solved

2017-04-20 Thread Phil
On Wed, 19 Apr 2017 22:21:28 -0500 Just to save people answering this question unnecessarily I have solved the immediate problem. I can now enter a digit at the mouse coordinates. Some refinement is still necessary. -- Regards, Phil ___ Tutor maillis

Re: [Tutor] Tkinter layout question

2017-04-20 Thread Phil
On Wed, 19 Apr 2017 22:21:28 -0500 boB Stepp wrote: Thank you Bob and Palm for your replies. They have given me something more tto think about. ideas > I don't know (now) how to solve your challenges below. But if I were > trying to figure this out, I would try to find more complex tkinter > ex

Re: [Tutor] Tkinter layout question

2017-04-19 Thread boB Stepp
I don't know (now) how to solve your challenges below. But if I were trying to figure this out, I would try to find more complex tkinter example applications that contain some of the issues I'd be interested in. Then I would dig into the code, find the relevant pieces, and then start playing with

[Tutor] Tkinter layout question

2017-04-19 Thread Phil
I'm looking for ideas here. A working solution for my sudoku solver is a 9 x 9 grid of entry boxes but it looks a bit basic. So I created a 9 x 9 grid on a canvas which looks much better. I can display digits in the centre of the squares but entering the digits from the keyboard seems to be bey

Re: [Tutor] Tkinter and canvas question

2017-04-18 Thread Phil
On Mon, 17 Apr 2017 22:57:41 -0500 boB Stepp wrote: > I have yet to do much class writing with tkinter, but if I am > understanding things correctly, in your Sudoku class where you > instantiate a Canvas instance, you assign it to the name "the_canvas". > This will be local to the __init__ method

Re: [Tutor] Tkinter and canvas question

2017-04-18 Thread Alan Gauld via Tutor
On 18/04/17 00:13, Phil wrote: > Thank you for reading this. > > How do I reference the_canvas from my solve() method? > class Sudoku(Frame): > def __init__(self, parent): > Frame.__init__(self, parent) > self.parent = parent > > parent.title("Sudoku solver") >

Re: [Tutor] Tkinter and canvas question

2017-04-17 Thread boB Stepp
Sorry for the unnecessary post with no response -- inadvertent click on "Send" button which was too near Gmail's "..." button to expand content. On Mon, Apr 17, 2017 at 6:13 PM, Phil wrote: > Thank you for reading this. > > How do I reference the_canvas from my solve() method? Despite hours of >

Re: [Tutor] Tkinter and canvas question

2017-04-17 Thread boB Stepp
On Mon, Apr 17, 2017 at 6:13 PM, Phil wrote: > Thank you for reading this. > > How do I reference the_canvas from my solve() method? Despite hours of > searching I haven't been able to solve this or find a similar example. All > that I've gained is a headache. > > Exception in Tkinter callback >

[Tutor] Tkinter and canvas question

2017-04-17 Thread Phil
Thank you for reading this. How do I reference the_canvas from my solve() method? Despite hours of searching I haven't been able to solve this or find a similar example. All that I've gained is a headache. Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3

Re: [Tutor] Tkinter entry box text changed event

2017-04-10 Thread Phil
On Mon, 10 Apr 2017 19:40:01 +0100 Alan Gauld via Tutor wrote: > You want two parameters > self becaiuse its a method of a class so must have a self > event which is the event passsed by the GUI > So: > > def my_method(self, event): > print("method called with ",event) > > > > I must be cl

Re: [Tutor] Tkinter entry box text changed event

2017-04-10 Thread Alan Gauld via Tutor
On 10/04/17 10:18, Phil wrote: > def my_method(self.event): > print("method called") > > (self.event) is a syntax error and if I leave off "self", this is the result: You want two parameters self becaiuse its a method of a class so must have a self event which is the event passsed by the GUI

Re: [Tutor] Tkinter entry box text changed event

2017-04-10 Thread Phil
On Mon, 10 Apr 2017 09:31:10 +0200 Peter Otten <__pete...@web.de> wrote: > entry.bind("", bye) Thank you Peter and Alan, I had tried key-press but that caused the error message shown bellow which made me think that I was not on the correct track. So in desperation, after hours of frustrati

Re: [Tutor] Tkinter entry box text changed event

2017-04-10 Thread Alan Gauld via Tutor
On 10/04/17 05:43, Phil wrote: > I would like a function to be called when I enter text > and then tab to the next entry box. One of the things about Entry boxes is that they are extremely flexible and have many event types associated with them. The consequence of this is that you as a programmer

Re: [Tutor] Tkinter entry box text changed event

2017-04-10 Thread Peter Otten
Phil wrote: > Again, thank you for reading this. > > I would like a function to be called when I enter text and then tab to the > next entry box. I've been trying to follow the answers to similar > questions in Stack Overflow but I've become hopelessly confused because of > the different answers

[Tutor] Tkinter entry box text changed event

2017-04-09 Thread Phil
Again, thank you for reading this. I would like a function to be called when I enter text and then tab to the next entry box. I've been trying to follow the answers to similar questions in Stack Overflow but I've become hopelessly confused because of the different answers given to seemingly the

Re: [Tutor] Tkinter class question - solved

2017-04-08 Thread Alan Gauld via Tutor
On 07/04/17 20:21, Phil wrote: > After a bit more thought I now realise that I just > need to use self to reference e[][] in my check function. You need to use self any time you access any member of your class. So in your case: class TestGUI: def __init__(self, master): self.master

Re: [Tutor] Tkinter class question

2017-04-08 Thread Peter Otten
Phil wrote: > On Sat, 08 Apr 2017 09:12:17 +0200 > Peter Otten <__pete...@web.de> wrote: > > Thank you yet again Peter. > > I realised what the answer is after taking a break for a couple of hours, > however, I didn't know about: > >> ... >> self.check_button = Button( >>

Re: [Tutor] Tkinter class question - solved

2017-04-08 Thread Peter Otten
Phil wrote: > On Sat, 8 Apr 2017 02:00:38 +1000 > > This is one of those times where I wish I could delete a sent message. > > After a bit more thought I now realise that I just need to use self to > reference e[][] in my check function. Relax ;) We all had to go through a learning process.

Re: [Tutor] Tkinter class question

2017-04-08 Thread Phil
On Sat, 08 Apr 2017 09:12:17 +0200 Peter Otten <__pete...@web.de> wrote: Thank you yet again Peter. I realised what the answer is after taking a break for a couple of hours, however, I didn't know about: > ... > self.check_button = Button( > master, > tex

Re: [Tutor] Tkinter class question - solved

2017-04-08 Thread Phil
On Sat, 8 Apr 2017 02:00:38 +1000 This is one of those times where I wish I could delete a sent message. After a bit more thought I now realise that I just need to use self to reference e[][] in my check function. -- Regards, Phil ___ Tutor maillist

Re: [Tutor] Tkinter class question

2017-04-08 Thread Alan Gauld via Tutor
On 07/04/17 17:00, Phil wrote: > ...I'm now having a problem knowing when to use the "self" reference. self is needed every time you use an instance attribute or method. It is equivalent to 'this' in C++(or Java), but in Python it is never implicit you always have to explicitly specify self when

Re: [Tutor] Tkinter class question

2017-04-08 Thread Peter Otten
Phil wrote: > I've progressed a little further but I'm now having a problem knowing when > to use the "self" reference. In the following code, the function "ckeck" > is called without the need to press the "check" button. This didn't occur > before I sprinkled "selfs" into the code and added "arra

Re: [Tutor] Tkinter class question - refinement

2017-04-07 Thread Phil
On Sat, 8 Apr 2017 02:00:38 +1000 Phil wrote: If I define "e" lists before the class then everything works as I had expected, however, I don't that's technically correct. Or is it? -- Regards, Phil ___ Tutor maillist - Tutor@python.org To unsubscri

[Tutor] Tkinter class question

2017-04-07 Thread Phil
Thank you for reading this. I've progressed a little further but I'm now having a problem knowing when to use the "self" reference. In the following code, the function "ckeck" is called without the need to press the "check" button. This didn't occur before I sprinkled "selfs" into the code and

Re: [Tutor] Tkinter grid question

2017-04-07 Thread Alan Gauld via Tutor
On 07/04/17 11:08, Phil wrote: > ...In this case I become confused because had expected [][] > to be the same as a C two dimensional array. It is, sort of. If you set the data up correctly to start with :-) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.am

Re: [Tutor] Tkinter grid question

2017-04-07 Thread Phil
On Fri, 07 Apr 2017 10:01:21 +0200 Peter Otten <__pete...@web.de> wrote: > > e = [None] * 6 , [None] * 2 > > In the above line you are creating a 2-tuple consisting of two lists: > > >>> [None]*6, [None]*2 > ([None, None, None, None, None, None], [None, None]) > > What you want is a list of lis

Re: [Tutor] Tkinter grid question

2017-04-07 Thread Phil
On Fri, 7 Apr 2017 10:08:40 +0100 Alan Gauld via Tutor wrote: > Peter has already answered the problem but I'd like > to point out how he used the interactive prompt >>> to > demonstrate what was going wrong. Thank you Alan. The >>> prompt, print() and Duckduckgo do get a good workout. In this

Re: [Tutor] Tkinter grid question

2017-04-07 Thread Alan Gauld via Tutor
On 07/04/17 03:09, Phil wrote: > Thank you for reading this. > > This is my first attempt at using Tkinter and I've quickly run into a problem. > Peter has already answered the problem but I'd like to point out how he used the interactive prompt >>> to demonstrate what was going wrong. You shoul

Re: [Tutor] Tkinter grid question

2017-04-07 Thread Peter Otten
Phil wrote: > Thank you for reading this. > > This is my first attempt at using Tkinter and I've quickly run into a > problem. > > If e is a one dimensional list then all is OK and I can delete and insert > entries. The problem comes about when the list is made two dimensional, as > follows: >

[Tutor] Tkinter grid question

2017-04-07 Thread Phil
Thank you for reading this. This is my first attempt at using Tkinter and I've quickly run into a problem. If e is a one dimensional list then all is OK and I can delete and insert entries. The problem comes about when the list is made two dimensional, as follows: from tkinter import * master

Re: [Tutor] Tkinter Calendar to receive user entry.

2017-02-07 Thread Alan Gauld via Tutor
On 07/02/17 19:40, Peter Otten wrote: >>> from ttkcalendar import Calendar >> >> Doesn't work for me in either Python 3.6.0 or in Python 2.7.6 >> >> Which version of 2.7 are you using? > > The distribution's Python 2.7.6 on Linux Mint 17. After fixing the import > statements... OK, I went back

Re: [Tutor] Tkinter Calendar to receive user entry.

2017-02-07 Thread Peter Otten
Alan Gauld via Tutor wrote: > On 07/02/17 10:18, Peter Otten wrote: > >> $ cat demo.py >> #!/usr/bin/env python >> import calendar >> import ttk >> import Tkinter >> from ttkcalendar import Calendar > > Doesn't work for me in either Python 3.6.0 or in Python 2.7.6 > > Which version of 2.7 are y

Re: [Tutor] Tkinter Calendar to receive user entry.

2017-02-07 Thread Alan Gauld via Tutor
On 07/02/17 10:18, Peter Otten wrote: > $ cat demo.py > #!/usr/bin/env python > import calendar > import ttk > import Tkinter > from ttkcalendar import Calendar Doesn't work for me in either Python 3.6.0 or in Python 2.7.6 Which version of 2.7 are you using? -- Alan G Author of the Learn to Pr

Re: [Tutor] Tkinter Calendar to receive user entry.

2017-02-07 Thread Pooja Bhalode
Hi Alan, Thank you so much for your advice, I would start looking into learning some object oriented programming to make myself familiar with it. That would help me move ahead as well. Hi Peter, Thank you so much for your reply. Yes, that was the example that I was looking at on stackoverflow. Y

Re: [Tutor] Tkinter Calendar to receive user entry.

2017-02-07 Thread Peter Otten
Alan Gauld via Tutor wrote: > On 07/02/17 00:24, Pooja Bhalode wrote: > >> I am trying to create a calendar using tkinter GUI such that when the >> user opens the GUI, > > So far as I'm aware there is no such Calendar widget in the standard > modules, you would need to find a third party module.

Re: [Tutor] Tkinter Calendar to receive user entry.

2017-02-07 Thread Alan Gauld via Tutor
On 07/02/17 00:24, Pooja Bhalode wrote: > I am trying to create a calendar using tkinter GUI such that when the user > opens the GUI, So far as I'm aware there is no such Calendar widget in the standard modules, you would need to find a third party module. > Can some one please help me with thi

[Tutor] Tkinter Calendar to receive user entry.

2017-02-07 Thread Pooja Bhalode
Hi, I am trying to create a calendar using tkinter GUI such that when the user opens the GUI, it would show a drop down menu similar to the one seen on flight websites for booking and then the user can select any specific date. I need to make this such that the user can navigate between years and

Re: [Tutor] Tkinter Copy/Paste/Cut functionalities

2017-02-04 Thread Alan Gauld via Tutor
On 04/02/17 02:34, Pooja Bhalode wrote: > I came across some snippets of the code to do this but using a self class. I'm not sure what you mean by a "self class"? > I was wondering if some one could help me create these functionalities in a > manner similar to the following code. (similar to the

[Tutor] Tkinter Copy/Paste/Cut functionalities

2017-02-04 Thread Pooja Bhalode
Hi, I am new to tkinter and looking for some help with select/copy/paste functionalities. I wish to keep these tabs in the Edit menu and as well as be able to do it using the shortcut keys. Here, I am trying to create a GUI and needed some help with that. I came across some snippets of the code to

Re: [Tutor] tkinter/sqlite3?

2016-08-26 Thread Jim Byrnes
On 08/26/2016 04:22 AM, Alan Gauld via Tutor wrote: On 26/08/16 02:34, Jim Byrnes wrote: Exception in Tkinter callback Traceback (most recent call last): ... File "tk_pwds.py", line 56, in fill_accounts_lb cur.execute('''SELECT Account FROM pwds WHERE Category=? ORDER BY Account COLLA

Re: [Tutor] tkinter/sqlite3?

2016-08-26 Thread Jim Byrnes
On 08/26/2016 02:03 AM, Peter Otten wrote: Jim Byrnes wrote: I am working with Python 3.4.3 on Ubuntu 14.04. I am learning tkinter so I decided to rewrite a program I had written in pythoncard in tkinter. I found that a sqlite3 SELECT statement that works in pythoncard throws an error in tkint

Re: [Tutor] tkinter/sqlite3?

2016-08-26 Thread Alan Gauld via Tutor
On 26/08/16 02:34, Jim Byrnes wrote: > Exception in Tkinter callback > Traceback (most recent call last): ... >File "tk_pwds.py", line 56, in fill_accounts_lb > cur.execute('''SELECT Account FROM pwds WHERE Category=? ORDER BY > Account COLLATE NOCASE''', category) > sqlite3.ProgrammingE

Re: [Tutor] tkinter/sqlite3?

2016-08-26 Thread Peter Otten
Jim Byrnes wrote: > I am working with Python 3.4.3 on Ubuntu 14.04. > > I am learning tkinter so I decided to rewrite a program I had written in > pythoncard in tkinter. I found that a sqlite3 SELECT statement that > works in pythoncard throws an error in tkinter and am wondering why? > > # Fill

[Tutor] tkinter/sqlite3?

2016-08-25 Thread Jim Byrnes
I am working with Python 3.4.3 on Ubuntu 14.04. I am learning tkinter so I decided to rewrite a program I had written in pythoncard in tkinter. I found that a sqlite3 SELECT statement that works in pythoncard throws an error in tkinter and am wondering why? # Fill the accounts listbox from th

Re: [Tutor] Tkinter and threading

2016-06-02 Thread Marco Soldavini
Thanks for you answers! On Thu, Jun 2, 2016 at 6:39 PM, Peter Otten <__pete...@web.de> wrote: >> For example a state machine with a var state which can have some >> discrete string values (like RUNNING, STOPPED, PAUSED, ABORTED, IDLE) >> and a text element on the gui that reports that state. >> >

Re: [Tutor] Tkinter and threading

2016-06-02 Thread Peter Otten
Marco Soldavini wrote: > Hello, > probably this is a very naive question, but I've read some stuff on > Tkinter and its infinite loop. > > Then about how can i bind actions to elements, for example buttons. > > What if I want to run another loop beside the graphical interface in > the same pytho

Re: [Tutor] Tkinter and threading

2016-06-02 Thread Alan Gauld via Tutor
On 02/06/16 14:40, Marco Soldavini wrote: > What if I want to run another loop beside the graphical interface in > the same python script? You need to do it in a separate thread. Keep the Tkinter loop on your main thread and use it to trigger actions. > For example a state machine with a var sta

[Tutor] Tkinter and threading

2016-06-02 Thread Marco Soldavini
Hello, probably this is a very naive question, but I've read some stuff on Tkinter and its infinite loop. Then about how can i bind actions to elements, for example buttons. What if I want to run another loop beside the graphical interface in the same python script? For example a state machine w

Re: [Tutor] tkinter create a frame and whats the parent

2015-09-23 Thread Peter Otten
David Niklas wrote: > Hello, I was following the doc, and in the beginning he gives an > example where he creates a frame and accesses the main window by the > name of Master. > > http://infohost.nmt.edu/tcc/help/pubs/tkinter/tkinter.pdf I suppose you are asking about """ #!/usr/bin/env python

[Tutor] tkinter create a frame and whats the parent

2015-09-22 Thread David Niklas
Hello, I was following the doc, and in the beginning he gives an example where he creates a frame and accesses the main window by the name of Master. http://infohost.nmt.edu/tcc/help/pubs/tkinter/tkinter.pdf I wanted to know, does the name have to be Master? And why does he pass a second arg to t

Re: [Tutor] tkinter in Python 3

2015-08-27 Thread Alan Gauld
On 27/08/15 18:21, Michael Thomas wrote: I'm trying to move a Python 2.x program to Python 3.x. When I try to import tkinter I get the error message that no module _tkinter can be found. I've tried sudo apt-get install python-tk. Thats the Python2 version Try apt-get install python3-tk Note

Re: [Tutor] tkinter in Python 3

2015-08-27 Thread Rohan S
I am trying to download a version of Pygame that is compatible with Python 2.7.10; when I try to run a simple program, I get an error message stating that terms like "livewires", "Sprite", "pygame", and "screen", are unresolved references, and so I assume that downloading pygame could solve this pr

[Tutor] tkinter in Python 3

2015-08-27 Thread Michael Thomas
I'm trying to move a Python 2.x program to Python 3.x. When I try to import tkinter I get the error message that no module _tkinter can be found. I've tried sudo apt-get install python-tk. While this command works, there is no difference in the result. This problem has only cropped up after I chang

  1   2   3   4   5   >