[Tutor] New Python testing book

2010-02-12 Thread Alan Gauld
Amazon have just brought to my attention the following title: Python Testing: Beginner's Guide Has anyone seen this? Is it any good? What test frameworks does it cover? Amazon are remarkably reticent about the actual contents. Its very new, only published on 22nd January. Alan G.

Re: [Tutor] New Python testing book

2010-02-12 Thread David
Hi Alan, On 12/02/10 17:34, Alan Gauld wrote: Amazon are remarkably reticent about the actual contents. See here: http://tinyurl.com/y9dy62p I am, btw, always happy to see 'book announcements' on this list -- keep them coming! David ___ Tutor

Re: [Tutor] New Python testing book

2010-02-12 Thread Evans Anyokwu
On Fri, Feb 12, 2010 at 10:26 AM, David ld...@gmx.net wrote: Hi Alan, On 12/02/10 17:34, Alan Gauld wrote: Amazon are remarkably reticent about the actual contents. See here: http://tinyurl.com/y9dy62p I am, btw, always happy to see 'book announcements' on this list -- keep them

Re: [Tutor] Coin flip game

2010-02-12 Thread Albert-Jan Roskam
Hi, random.choice offers an intuitive way to write the code: import random for i in range(10):     print random.choice([head, tail]) Cheers!! Albert-Jan ~~ In the face of ambiguity, refuse the temptation to guess.

[Tutor] Tutor list as pair progamming plush toy

2010-02-12 Thread Mac Ryan
Have you ever got that piece of advice about - when you have stuck on a bug you seem unable to track - getting a plush toy to whom you explain your code? (This is of course a workaround if you do not have a fellow developer to help you out). Well... I found out this advice kind of works for me,

Re: [Tutor] Tutor list as pair progamming plush toy

2010-02-12 Thread Serdar Tumgoren
In similar vein, I find that a concept suddenly makes more sense to me when I try to explain it to someone else (or I realize that I don't fully understand and need to do some more research). But with regard to the plush toy you mention, I just ran into that anecdote in Coders at Work. Can't

Re: [Tutor] Tutor list as pair progamming plush toy

2010-02-12 Thread Hansen, Mike
-Original Message- From: tutor-bounces+mike.hansen=atmel@python.org [mailto:tutor-bounces+mike.hansen=atmel@python.org] On Behalf Of Mac Ryan Sent: Friday, February 12, 2010 8:33 AM To: tutor@python.org Subject: [Tutor] Tutor list as pair progamming plush toy Have

Re: [Tutor] Tutor list as pair progamming plush toy

2010-02-12 Thread Wayne Werner
I've discovered that same thing. Usually I end out not sending my message because in the process of composing my email I end out I, too, find the errors. -Wayne ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

[Tutor] batch file processing w/ python using cmd line executable?

2010-02-12 Thread kevin parks
hi I am new territory here and not even sure where to start poking around other than the os module some. Essentially i need to do something like a shell script for batch processing gobs of files. I am trying to use a command line tool (sox, an open source sound file converter that runs

Re: [Tutor] Algorithm for combination analysis suggestion.

2010-02-12 Thread Gerard Flanagan
Matthew Matson wrote: Hi Tutors, I am looking for the proper approach regarding the analysis of a dictionary of combinations I have. What I need to do is read from a supplied text file that has a unique ID and that unique ID's associated combination of elements. So let's say I have the

Re: [Tutor] Tutor list as pair progamming plush toy

2010-02-12 Thread David Hutto
--- On Fri, 2/12/10, Hansen, Mike mike.han...@atmel.com wrote: From: Hansen, Mike mike.han...@atmel.com Subject: Re: [Tutor] Tutor list as pair progamming plush toy To: tutor@python.org Date: Friday, February 12, 2010, 11:55 AM -Original Message- From:

Re: [Tutor] Tutor list as pair progamming plush toy

2010-02-12 Thread Alan Gauld
Mac Ryan quasipe...@gmail.com wrote I know - this is slightly OT for the list - but I thought to share as maybe this is a hidden benefit the list is bringing to a few people without the tutors even knowing it. Actually I think it is bang on topic. One of the most common benefits of any

Re: [Tutor] batch file processing w/ python using cmd line executable?

2010-02-12 Thread Alan Gauld
kevin parks k...@mac.com wrote I wonder if it is possible to use python to call sox and have it do os.mkdir, process all the input files in a particular directory and put the converted files into the directory it made with mkdir... Of course. What do you perceive to be the problem? This

[Tutor] Defining operators for custom types

2010-02-12 Thread Mark Young
I created a custom vector type, inheriting from object, and defined __mul__, __add__, etc. Unfortunately, the operators only work if I type vector * (int/float/number), in that exact order. My program produces an error if I instead type number * vector. This makes sense to me, because I haven't

Re: [Tutor] Defining operators for custom types

2010-02-12 Thread bob gailer
Mark Young wrote: I created a custom vector type, inheriting from object, and defined __mul__, __add__, etc. Unfortunately, the operators only work if I type vector * (int/float/number), in that exact order. My program produces an error if I instead type number * vector. Use __rmul__,

Re: [Tutor] Defining operators for custom types

2010-02-12 Thread Mark Young
Thanks for the help. That's exactly the kind of solution I wanted. I've been to that page several times already, but just ignored that section apparently. Thanks alot. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

[Tutor] aliasing an imported module

2010-02-12 Thread Garry Willgoose
I want to be able to import multiple instances of a module and call each by a unique name and it doesn't appear at first glance that either import or __import__ have what I need. I need this because of computing platform I have developed where users write python scripts to do some analysis

Re: [Tutor] aliasing an imported module

2010-02-12 Thread Alan Gauld
Garry Willgoose garry.willgo...@newcastle.edu.au wrote I want to be able to import multiple instances of a module and call each by a unique name and it doesn't appear at first glance that either import or __import__ have what I need. No because it would be bad practice. Stateful modules

[Tutor] Just a Note

2010-02-12 Thread Randy Raymond
By the way, Alan Gauld's emails generate an error in my system. His is the only emails I have a problem with so far. At first it tried to open a News service. Randy Raymond ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] Just a Note

2010-02-12 Thread Luke Paireepinart
This doesn't make any sense. What do you mean tries to open up a news service? When you read the e-mail? What system are you using? On Fri, Feb 12, 2010 at 8:30 PM, Randy Raymond randyeraym...@mchsi.comwrote: By the way, Alan Gauld's emails generate an error in my system. His is the only

[Tutor] The Order of Imports and install order of modules and other matters (XP vs W7, ...)

2010-02-12 Thread Wayne Watson
There seems to be something of a general consensus in ordering import statements. Something like standard library imports first. When using tools like matlablib or tkinter (maybe), must one keep an order among the relevant imports? Related to this is the order in which modules are installed.

[Tutor] Not understanding this code example. Help, please.

2010-02-12 Thread Eduardo Vieira
Hello! I was reading the latest version of Mark Pilgrim's Dive into Python and am confused with these example about the pluralization rules. See http://diveintopython3.org/examples/plural3.py and http://diveintopython3.org/generators.html#a-list-of-patterns Here is part of the code: import re def