[Tutor] Another mention on xkcd...

2008-04-23 Thread Marc Tompkins
I don't know whether there are any other xkcd fans here, but I am, and I was very happy to see Python mentioned again... http://xkcd.com/413/ Sometimes it really does seem that easy. -- www.fsrtechnologies.com ___ Tutor maillist - Tutor@python.org h

Re: [Tutor] Recursion doubt

2008-04-23 Thread Anshu Raval
Hi, Thank you so much for your response. I followed the 2 reasonings you gave, -- You can look at find_all as a master routine that keeps calling find_path until find_path gives up. If the search space has not been exhausted (here there are still other nodes connected to 'start') take a suit

[Tutor] knowing when a list is updated by a thread

2008-04-23 Thread Vaibhav.bhawsar
i have this code to print every new element in a list only when the list length changes (while the list is updated by a thread running elsewhere)...I was wondering if there is a pythonic way to do this? how does one know when there is a new element in the list? prevlength = 0 while geoCode.run

Re: [Tutor] knowing when a list is updated by a thread

2008-04-23 Thread linuxian iandsd
if i only wanted the last element ofthe list, i would change the "geoCode.getResults()' to return to me both the complete list & the new elements in the list. it should be pretty easy from there. if what you need is to sort the list & see whether a value have changed or not then you will be better

Re: [Tutor] knowing when a list is updated by a thread

2008-04-23 Thread Kent Johnson
Vaibhav.bhawsar wrote: i have this code to print every new element in a list only when the list length changes (while the list is updated by a thread running elsewhere)...I was wondering if there is a pythonic way to do this? how does one know when there is a new element in the list? prevleng

Re: [Tutor] Recursion doubt

2008-04-23 Thread Kent Johnson
Anshu Raval wrote: But my question would again be how do you know to put square brackets around path in if start == end: return [path] in find_all_paths. I am still puzzled by this. find_all_paths() returns a *list* of paths, even when the result is a single path. Without the brac

Re: [Tutor] knowing when a list is updated by a thread

2008-04-23 Thread bob gailer
Kent Johnson wrote: Vaibhav.bhawsar wrote: i have this code to print every new element in a list only when the list length changes (while the list is updated by a thread running elsewhere)...I was wondering if there is a pythonic way to do this? how does one know when there is a new element in

Re: [Tutor] knowing when a list is updated by a thread

2008-04-23 Thread Hansen, Mike
> Evey time someone recommends Queue I think "oh boy this will > really help > me". Then I go to the Library Reference, read the Queue docs > and think > "oh boy who can help me understand this". Even the sample code is > confusing. > > Is there some other documentation or example? > > >

Re: [Tutor] knowing when a list is updated by a thread

2008-04-23 Thread Hansen, Mike
> Evey time someone recommends Queue I think "oh boy this will > really help > me". Then I go to the Library Reference, read the Queue docs > and think > "oh boy who can help me understand this". Even the sample code is > confusing. > > Is there some other documentation or example? > > >

Re: [Tutor] Using Queue

2008-04-23 Thread Kent Johnson
On Wed, Apr 23, 2008 at 9:46 AM, bob gailer <[EMAIL PROTECTED]> wrote: > Evey time someone recommends Queue I think "oh boy this will really help > me". Then I go to the Library Reference, read the Queue docs and think "oh > boy who can help me understand this". Even the sample code is confusing.

Re: [Tutor] Using Queue

2008-04-23 Thread bob gailer
Kent Johnson wrote: On Wed, Apr 23, 2008 at 9:46 AM, bob gailer <[EMAIL PROTECTED] > wrote: Evey time someone recommends Queue I think "oh boy this will really help me". Then I go to the Library Reference, read the Queue docs and think "oh boy who can help

Re: [Tutor] Using Queue

2008-04-23 Thread Marc Tompkins
I for one would like to thank Bob for asking the question! So far I hadn't had the guts. -- www.fsrtechnologies.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using Queue

2008-04-23 Thread Tim Golden
bob gailer wrote: Kent Johnson wrote: On Wed, Apr 23, 2008 at 9:46 AM, bob gailer <[EMAIL PROTECTED] > wrote: Evey time someone recommends Queue I think "oh boy this will really help me". Then I go to the Library Reference, read the Queue docs and think "o

Re: [Tutor] knowing when a list is updated by a thread

2008-04-23 Thread Vaibhav.bhawsar
Some good ideas! Kent I looked at the queue module and that looks like something I would use. will post my results. Thanks On Wed, Apr 23, 2008 at 9:52 AM, Hansen, Mike <[EMAIL PROTECTED]> wrote: > > > > Evey time someone recommends Queue I think "oh boy this will > > really help > > me". Then I

Re: [Tutor] Using Queue

2008-04-23 Thread Kent Johnson
On Wed, Apr 23, 2008 at 1:17 PM, bob gailer <[EMAIL PROTECTED]> wrote: > "The Queue module implements a multi-producer, multi-consumer FIFO queue. > > I understand producer, comsumer, FIFO. > > I don't understand multi- More than one producer and/or consumer > > > "It is especially useful in th

Re: [Tutor] Using Queue

2008-04-23 Thread Kent Johnson
On Wed, Apr 23, 2008 at 1:36 PM, Tim Golden <[EMAIL PROTECTED]> wrote: > Yes, that's a typical setup for Queue: the main thread creates a > Queue and passes it to each thread it creates. Say you had an example > where you had a pool of worker threads, each one performing a > calculation. A common

[Tutor] Needing help with variables

2008-04-23 Thread Cain, Steven
I have the code below and I am in need of a little help with variables. What I am trying to do is substitute a variable where it says insert variable. I actually need to place 3 variables. 1 for date, 1 for time and 1 for a string of text. Any help would be greatly appreciated. Steve def Backwar

Re: [Tutor] Needing help with variables

2008-04-23 Thread Kent Johnson
On Wed, Apr 23, 2008 at 2:55 PM, Cain, Steven <[EMAIL PROTECTED]> wrote: > I have the code below and I am in need of a little help with variables. > What I am trying to do is substitute a variable where it says insert > variable. I actually need to place 3 variables. 1 for date, 1 for time > and

[Tutor] Open Source Hero my @$$!

2008-04-23 Thread Marc Tompkins
Just thought I'd share something I found quite humorous... a while back, I heard about Microsoft's "Open Source Hero" program, and being a curious type I signed up. Hey, I love me some Open Source, and I wanna be a hero, right? My Hero Pack arrived a few days ago. It contains: a 90-day trial o