[Python Wpg] Gnome background switcher!!!

Scott Balneaves sbalneav at legalaid.mb.ca
Tue Jun 6 10:37:08 EDT 2006


On Mon, Jun 05, 2006 at 10:33:11PM -0500, Stuart Williams wrote:

<snip>

> First, there's an os.walk function which you could use like this, also
> switching the filelist to a value returned from walk_tree.

Ah, even better.  I'm still trying to learn all the goodies that are
available in the standard library.  Generally, my learning goes thusly:

1) Figure out what I need to do
2) Figure out how I should be doing it in Python
3) Code the function, test, get working.
4) Find out there was a standard library function that already did what 
   I wanted.
5) Slap forhead
6) ???
7) Profit!!!

> Also the itertools.cycle function can simplify the switching code
> thusly:

Step 5

> By the way, is the thread.Threading.Condition lock (acquire/release)
> necessary?

Probably not, but it was in the skeleton framework I found, so I left it
in there as a matter of course.  It could probably come out, as there's
only the one thread.

Scott

-- 
Scott L. Balneaves | "Looking beyond the embers of bridges glowing behind us
Systems Department |  To a glimpse of how green it was on the other side..."
Legal Aid Manitoba |    -- Pink Floyd "High Hopes"



More information about the Winnipeg mailing list