Re: [Tutor] Tkinter, widgets not displaying...

2006-02-09 Thread John Fouhy
On 10/02/06, Hugo González Monteverde <[EMAIL PROTECTED]> wrote: > Sorry for replying to myself, but I found a page that says that it can > be done without threads... so it hit me: use threads!!! (duh) Yes, this will be what you need. Your GUI won't do anything until you run mainloop, and mainloo

Re: [Tutor] Tkinter, widgets not displaying...

2006-02-09 Thread Hugo González Monteverde
Sorry for replying to myself, but I found a page that says that it can be done without threads... so it hit me: use threads!!! (duh) Ok, for future reference, this is the part where I use the classes I defined: if __name__ == "__main__": top = Tkinter.Tk() myturns = TurnQueue(top, pw=

Re: [Tutor] IDE - Editors - Python

2006-02-09 Thread Hugo González Monteverde
> I'm programming under Windows and I haven't found anything better than > Stani's Python Editor (spe). It should be cross-platform. > I second SPE under Windows, though under linux I keep using vim. The included utilities are great (I love Kiki) The only caveat would be that running wxpytho

[Tutor] Tkinter, widgets not displaying...

2006-02-09 Thread Hugo González Monteverde
Hi All, I wrote a small turn delivering graphical app that is supposed to display turns in a queue. If I instantiate the class and call its methods, thus displaying strings in several canvases, from the interactive prompt, everything works fine. If I do it when running the script as a progra

Re: [Tutor] Time to Use a Global Variable?

2006-02-09 Thread Hugo González Monteverde
Hi Rich I guess passing a reference to the database handler instance that contains closeDB to your app's __init__ is less dirty that having a global variable, what do you think? Hugo > >When I test the application and try to close it, python complains >File "eikos.py", line 315, in On

Re: [Tutor] nutshell review

2006-02-09 Thread nephish
Sounds like its worth the wait. thanks all. shawn On Thu, 2006-02-09 at 19:02 -0800, Terry Carroll wrote: > On Fri, 10 Feb 2006, nephish wrote: > > > i know this comes up from time to time. i am considering buying 'python > > in a nutshell'. All the reviews i have read for it are very good. But

Re: [Tutor] nutshell review

2006-02-09 Thread Terry Carroll
On Thu, 9 Feb 2006, Andre Roberge wrote: > I own about 10 Python books including Learning Python, Programming > Python and Python in a Nutshell. Of these three, Python in a Nutshell > is the one I find the most useful. The Python Cookbook (2nd ed) is my > other favourite. Your mileage may vary.

Re: [Tutor] nutshell review

2006-02-09 Thread Terry Carroll
On Fri, 10 Feb 2006, nephish wrote: > i know this comes up from time to time. i am considering buying 'python > in a nutshell'. All the reviews i have read for it are very good. But it > only covers up to python 2.2. i use 2.3 at work, and tinker with 2.4 at > home. As good a reference as it is, i

Re: [Tutor] nutshell review

2006-02-09 Thread nephish
thanks man, ill check out cookbook & see what its all about, too. sk On Thu, 2006-02-09 at 22:22 -0400, Andre Roberge wrote: > On 2/9/06, nephish <[EMAIL PROTECTED]> wrote: > > lo there, > > i know this comes up from time to time. i am considering buying 'python > > in a nutshell'. All the revie

Re: [Tutor] nutshell review

2006-02-09 Thread Andre Roberge
On 2/9/06, nephish <[EMAIL PROTECTED]> wrote: > lo there, > i know this comes up from time to time. i am considering buying 'python > in a nutshell'. All the reviews i have read for it are very good. But it > only covers up to python 2.2. i use 2.3 at work, and tinker with 2.4 at > home. As good a

[Tutor] nutshell review

2006-02-09 Thread nephish
lo there, i know this comes up from time to time. i am considering buying 'python in a nutshell'. All the reviews i have read for it are very good. But it only covers up to python 2.2. i use 2.3 at work, and tinker with 2.4 at home. As good a reference as it is, is it too dated to be that good sti

Re: [Tutor] Breadth first search (fwd)

2006-02-09 Thread Danny Yoo
> I am new in Python so not sure how to do with Python to solve this > problem. Hi Nicky, Would you know how to do this problem in a different programming language? I'm not getting any sense at all at what experience or level you have. The question is just hard enough that asking it to a total

Re: [Tutor] Breadth first search (fwd)

2006-02-09 Thread Danny Yoo
[Forwarding the question on breadth first search to tutor] -- Forwarded message -- Date: Fri, 10 Feb 2006 07:25:05 +0800 From: Nicky Ng <[EMAIL PROTECTED]> To: Danny Yoo <[EMAIL PROTECTED]> Subject: Re: [Tutor] Breadth first search Dear Danny, I did not read the book u mentinoed

Re: [Tutor] Changing instance attributes in different threads

2006-02-09 Thread Michael Lange
On Wed, 08 Feb 2006 18:14:14 -0500 Kent Johnson <[EMAIL PROTECTED]> wrote: > > Sorry, I missed to insert the time.sleep(0.1) I used in my original while > > loop into the example above. > > The reason for using time.sleep() is that I need to avoid lots of loops > > over an empty buffer. > > The

Re: [Tutor] Breadth first search

2006-02-09 Thread Danny Yoo
On Thu, 9 Feb 2006, Nicky Ng wrote: > I would like to implement a breadth first serach with Python and read > data from a text file with following file format [cut] Hi Nicky, We've seen the problems from Programming Challenges: http://www.programming-challenges.com/pg.php?page=index and

Re: [Tutor] Time to Use a Global Variable?

2006-02-09 Thread Rich Shepard
On Thu, 9 Feb 2006, Alan Gauld wrote: > Those who come from a life sciences background or a traditional engineering > background can usually transition much more easily because they are used to > thinking in terms of systems of linked objects and their interactions. Alan, I suppose, then, tha

Re: [Tutor] Time to Use a Global Variable?

2006-02-09 Thread Alan Gauld
> As my software engineering colleague so tactfully and sensitively put > it, > it's very difficult for someone who's spent decades writing procedural > code > as a non-professional to stop thinking procedurally when working with an > object-oriented language. Actually its just as hard for pro

Re: [Tutor] Time to Use a Global Variable?

2006-02-09 Thread Rich Shepard
On Thu, 9 Feb 2006, Alan Gauld wrote: > I love the way you post problems and also post a possible > solution - usually the correct one! :-) Alan, Well, I try to be helpful. > Yes that's the problem. And so I fixed that last evening. As my software engineering colleague so tactfully

Re: [Tutor] Breadth first search

2006-02-09 Thread Kent Johnson
Nicky Ng wrote: > Hi, > > I would like to implement a breadth first serach with Python and read > data from a text file with following file format > > Could you give me any idea how to implement this search program with Python? Hmm, sounds like homework to me. The first thing I would do is p

Re: [Tutor] quirky multiple inheritance example!?

2006-02-09 Thread Kent Johnson
Alan Gauld wrote: >>> The problem is that super appears to only work with single inheritance. > > >> That's ironic - super() is intended to ease some of the problems with >> multiple inheritance especially diamond patterns. Some docs are here: >> http://www.python.org/2.2.3/descrintro.html#coope

[Tutor] Breadth first search

2006-02-09 Thread Nicky Ng
Hi,   I would like to implement a breadth first serach with Python and read data from a text file with following file format   File structure description First line contains number of node Second line contains node id(s) and distance between node id Last line is -1   Each node or distance i

Re: [Tutor] Splitting long string into same len parts

2006-02-09 Thread Kent Johnson
Victor Bouffier wrote: > Hi to all, > > I'd like to split a long string into equally long strings (len(str) = > 3). This is a very popular topic in the Python Cookbook. See for example http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/425044 http://aspn.activestate.com/ASPN/Cookbook/Python

Re: [Tutor] quirky multiple inheritance example!?

2006-02-09 Thread Alan Gauld
>> The problem is that super appears to only work with single inheritance. > That's ironic - super() is intended to ease some of the problems with > multiple inheritance especially diamond patterns. Some docs are here: > http://www.python.org/2.2.3/descrintro.html#cooperation > > The problem with

Re: [Tutor] Splitting long string into same len parts

2006-02-09 Thread Alan Gauld
Hi Victor, > I'd like to split a long string into equally long strings (len(str) = > 3). I did the following using regexes: > This is what I needed. Is there an easier or more straightforward way to > do this? Define easier :-) You could just use string slicing and a stepsize of 3 in range: ls

Re: [Tutor] python help

2006-02-09 Thread Alan Gauld
> has no human context whatsoever, so of course it's a useless homework > problem. Why would someone want to take a useless histogram of a bunch of > letters? Erm me! Communications analysts and cryptographers do that all the time! :-) The problem is fine, it's the context that would give it a

Re: [Tutor] python help

2006-02-09 Thread Alan Gauld
Ben, > Write a function that that uses X and Y techniques. > I realise teachers have to test mastery of certain > techniques, but they seem to lack the imagination. To be fair to teachers, its often the students who lack imagination. If you pose the problem as write an application to count the

Re: [Tutor] Finding bottom level directories, and command-line arguments

2006-02-09 Thread Alan Gauld
I've been away so missed this thead earlier but one wee thing I just noticed: >> --- >> def isBottomDir(path): >> for item in os.listdir(path): >> if os.path.isdir(os.path.join(path,item)): >> return False >> return True >> --- >> for root, dirs, files in os.wa

Re: [Tutor] Time to Use a Global Variable?

2006-02-09 Thread Alan Gauld
Rich, I love the way you post problems and also post a possible solution - usually the correct one! :-) > I've tried changing OnFileQuit to call DBinterface.closeDB(), but that > doesn't work. Obviously I still haven't completely grokked how to refer in > one class to a method defined in anoth