Re: Practice question

2014-10-09 Thread alister
On Mon, 06 Oct 2014 22:06:09 -0400, Seymore4Head wrote: > On Tue, 7 Oct 2014 01:46:37 + (UTC), Denis McMahon > wrote: > >>On Sun, 05 Oct 2014 19:02:31 -0400, Seymore4Head wrote: >> >>> For the record, I don't want a hint. I want the answer. >>>

Re: Practice question

2014-10-08 Thread Rustom Mody
On Wednesday, October 8, 2014 9:58:11 PM UTC+5:30, Skip Montanaro wrote: > On Wed, Oct 8, 2014 at 11:14 AM, Rustom Mody wrote: > > So pushing beginners away from print can push them up the learning > > curve more quickly > Or more quickly discourage them. I still use print for all sorts of > thin

Re: Practice question

2014-10-08 Thread Skip Montanaro
On Wed, Oct 8, 2014 at 11:14 AM, Rustom Mody wrote: > So pushing beginners away from print can push them up the learning > curve more quickly Or more quickly discourage them. I still use print for all sorts of things. In my opinion, there is often no need for fancy loggers, str.format, or the wri

Re: Practice question

2014-10-08 Thread Chris Angelico
On Thu, Oct 9, 2014 at 3:14 AM, Rustom Mody wrote: > The issue is not only that print is bad but that the interpreter is > good for learning and trying out. > > Are these two really unconnected. Lets see... One can > > - use print without the interpreter > - use the interpreter without print > - u

Re: Practice question

2014-10-08 Thread Rustom Mody
On Tuesday, October 7, 2014 2:19:39 AM UTC+5:30, Steven D'Aprano wrote: > I have fewer issues with your conclusion and analogy than I do with the > basic premise that there is a connection between Seymore's problem here > and the use, or non-use, of print in the interactive interpreter. I don't

Re: Practice question

2014-10-07 Thread C Smith
Steven D'Aprano wrote: >>With two numbers, 15 and 30, all you really need is five test cases: My solution assumed integers also, but after I posted it, I thought: "What about floating points?" On Tue, Oct 7, 2014 at 1:48 AM, Steven D'Aprano wrote: > On Sun, 05 Oct 2014 20:18:13 -0400, Seymore4He

Re: Practice question

2014-10-07 Thread Steven D'Aprano
On Sun, 05 Oct 2014 20:18:13 -0400, Seymore4Head wrote: > I think I get it now. You are using a sample of answers. So you could > actually just run through them all. (I haven't tried this yet) > > for x in range(lo,hi) > print((15 <= x < 30) == (15<= x and x <30)) Yes, except using print

Re: Practice question

2014-10-07 Thread Steven D'Aprano
On Sun, 05 Oct 2014 20:07:50 -0400, Seymore4Head wrote: > Here is the exact question, I was trying to post something similar. I > failed. > > http://i.imgur.com/iUGh4xf.jpg Please don't post screen shots if you can avoid it. You almost certainly can copy and paste the text from the web page. A

Re: Practice question

2014-10-06 Thread Seymore4Head
On Tue, 7 Oct 2014 01:46:37 + (UTC), Denis McMahon wrote: >On Sun, 05 Oct 2014 19:02:31 -0400, Seymore4Head wrote: > >> For the record, I don't want a hint. I want the answer. >> I see a practice question is similar to this. >> 15 <= x < 30 And it

Re: Practice question

2014-10-06 Thread Denis McMahon
On Sun, 05 Oct 2014 19:02:31 -0400, Seymore4Head wrote: > For the record, I don't want a hint. I want the answer. > I see a practice question is similar to this. > 15 <= x < 30 And it wants a similar expression that is equivalent. I think part of the problem here is that

Re: Practice question

2014-10-06 Thread Redge @ Versalytics.com
> On Oct 6, 2014, at 4:49 PM, Steven D'Aprano wrote: > >> On Mon, 06 Oct 2014 10:05:40 -0700, Rustom Mody wrote: >> >>> On Monday, October 6, 2014 10:22:27 PM UTC+5:30, Chris Angelico wrote: On Tue, Oct 7, 2014 at 3:23 AM, Rustom Mody wrote: Consider the sequence: 1. Drives on th

Re: Practice question

2014-10-06 Thread Steven D'Aprano
On Mon, 06 Oct 2014 10:05:40 -0700, Rustom Mody wrote: > On Monday, October 6, 2014 10:22:27 PM UTC+5:30, Chris Angelico wrote: >> On Tue, Oct 7, 2014 at 3:23 AM, Rustom Mody wrote: >> > Consider the sequence: >> > 1. Drives on the wrong side of the road 2. Has no clue that there's >> > such a con

Re: Practice question

2014-10-06 Thread Chris Angelico
On Tue, Oct 7, 2014 at 4:05 AM, Rustom Mody wrote: > On Monday, October 6, 2014 10:22:27 PM UTC+5:30, Chris Angelico wrote: >> On Tue, Oct 7, 2014 at 3:23 AM, Rustom Mody wrote: >> > Consider the sequence: >> > 1. Drives on the wrong side of the road >> > 2. Has no clue that there's such a concept

Re: Practice question

2014-10-06 Thread Rustom Mody
On Monday, October 6, 2014 10:22:27 PM UTC+5:30, Chris Angelico wrote: > On Tue, Oct 7, 2014 at 3:23 AM, Rustom Mody wrote: > > Consider the sequence: > > 1. Drives on the wrong side of the road > > 2. Has no clue that there's such a concept as 'wrong side of road' > > 3. Teaches people to drive wi

Re: Practice question

2014-10-06 Thread Chris Angelico
On Tue, Oct 7, 2014 at 3:23 AM, Rustom Mody wrote: > Consider the sequence: > > 1. Drives on the wrong side of the road > 2. Has no clue that there's such a concept as 'wrong side of road' > 3. Teaches people to drive without conveying anything about 'wrong side of > road' > > Hopefully you will

Re: Practice question

2014-10-06 Thread Rustom Mody
On Monday, October 6, 2014 6:34:27 PM UTC+5:30, Skip Montanaro wrote: > On Sun, Oct 5, 2014 at 9:47 PM, Rustom Mody wrote: > > Sorry Seymore if this sounds condescending -- its not a complaint > > against you but against those who treat the print statement/expression as > > kosher for newbies. >

Re: Practice question

2014-10-06 Thread Skip Montanaro
On Sun, Oct 5, 2014 at 9:47 PM, Rustom Mody wrote: > Sorry Seymore if this sounds condescending -- its not a complaint > against you but against those who treat the print statement/expression as > kosher for newbies. So if you're not griping about Seymore's original post, are you griping about my

Re: Practice question

2014-10-06 Thread C Smith
14 wrote: > On 10/5/14 7:02 PM, Seymore4Head wrote: >> >> For the record, I don't want a hint. I want the answer. >> I see a practice question is similar to this. >> 15 <= x < 30 And it wants a similar expression that is equivalent. >> So the right

Re: Practice question

2014-10-05 Thread Rustom Mody
On Monday, October 6, 2014 5:04:11 AM UTC+5:30, Skip Montanaro wrote: > On Oct 5, 2014 6:07 PM, Seymore4Head wrote: > > For the record, I don't want a hint.  I want the answer. > > I see a practice question is similar to this. > > 15 <= x < 30  And it wants a simil

Re: Practice question

2014-10-05 Thread Ned Batchelder
On 10/5/14 8:07 PM, Seymore4Head wrote: On Sun, 05 Oct 2014 19:14:27 -0400, Ned Batchelder wrote: On 10/5/14 7:02 PM, Seymore4Head wrote: For the record, I don't want a hint. I want the answer. I see a practice question is similar to this. 15 <= x < 30 And it wants a similar

Re: Practice question

2014-10-05 Thread Seymore4Head
On Sun, 05 Oct 2014 19:47:40 -0400, Terry Reedy wrote: >On 10/5/2014 7:02 PM, Seymore4Head wrote: >> For the record, I don't want a hint. I want the answer. >> I see a practice question is similar to this. >> 15 <= x < 30 And it wants a similar expression tha

Re: Practice question

2014-10-05 Thread Seymore4Head
On Sun, 05 Oct 2014 19:14:27 -0400, Ned Batchelder wrote: >On 10/5/14 7:02 PM, Seymore4Head wrote: >> For the record, I don't want a hint. I want the answer. >> I see a practice question is similar to this. >> 15 <= x < 30 And it wants a similar expression tha

Re: Practice question

2014-10-05 Thread Terry Reedy
On 10/5/2014 7:02 PM, Seymore4Head wrote: For the record, I don't want a hint. I want the answer. I see a practice question is similar to this. 15 <= x < 30 And it wants a similar expression that is equivalent. So the right answer is 15<= x or x <30 but one of the other answe

Re: Practice question

2014-10-05 Thread Skip Montanaro
On Oct 5, 2014 6:07 PM, "Seymore4Head" wrote: > > For the record, I don't want a hint. I want the answer. > I see a practice question is similar to this. > 15 <= x < 30 And it wants a similar expression that is equivalent. Maybe 30 > x >= 15

Re: Practice question

2014-10-05 Thread Ned Batchelder
On 10/5/14 7:02 PM, Seymore4Head wrote: For the record, I don't want a hint. I want the answer. I see a practice question is similar to this. 15 <= x < 30 And it wants a similar expression that is equivalent. So the right answer is 15<= x or x <30 No, "15 <= x < 3

Re: Practice question

2014-10-05 Thread Roy Smith
In article , Seymore4Head wrote: > For the record, I don't want a hint. I want the answer. 42. -- https://mail.python.org/mailman/listinfo/python-list

Practice question

2014-10-05 Thread Seymore4Head
For the record, I don't want a hint. I want the answer. I see a practice question is similar to this. 15 <= x < 30 And it wants a similar expression that is equivalent. So the right answer is 15<= x or x <30 but one of the other answers is not (15<= x and x <30) But i

Re: Best Practice Question

2013-02-06 Thread Jean-Michel Pichavant
- Original Message - > > [...] > > By the way, did someone ever notice that r'\' fails ? I'm sure > > there's a > > reason for that... (python 2.5) Anyone knows ? > > > > r'\' > > SyntaxError: EOL while scanning single-quoted string > > > > > "Even in a raw string, string quotes can be e

Re: Best Practice Question

2013-02-05 Thread Dave Angel
On 02/05/2013 11:53 AM, Joel Goldstick wrote: On Tue, Feb 5, 2013 at 11:40 AM, Anthony Correia wrote: On Tuesday, February 5, 2013 10:17:54 AM UTC-5, pytho...@tim.thechases.comwrote: On Tue, 5 Feb 2013 15:32:32 +0100 (CET), Jean-Michel Pichavant wrote: By the way, did someone ever notice tha

Re: Best Practice Question

2013-02-05 Thread Joel Goldstick
On Tue, Feb 5, 2013 at 11:40 AM, Anthony Correia wrote: > On Tuesday, February 5, 2013 10:17:54 AM UTC-5, > pytho...@tim.thechases.comwrote: > > On Tue, 5 Feb 2013 15:32:32 +0100 (CET), Jean-Michel Pichavant wrote: > > > > > By the way, did someone ever notice that r'\' fails ? I'm sure > > > > >

Re: Best Practice Question

2013-02-05 Thread Anthony Correia
On Tuesday, February 5, 2013 10:17:54 AM UTC-5, pytho...@tim.thechases.com wrote: > On Tue, 5 Feb 2013 15:32:32 +0100 (CET), Jean-Michel Pichavant wrote: > > > By the way, did someone ever notice that r'\' fails ? I'm sure > > > there's a reason for that... (python 2.5) Anyone knows ? > > > >

Re: Best Practice Question

2013-02-05 Thread python . list
On Tue, 5 Feb 2013 15:32:32 +0100 (CET), Jean-Michel Pichavant wrote: > By the way, did someone ever notice that r'\' fails ? I'm sure > there's a reason for that... (python 2.5) Anyone knows ? > > r'\' > SyntaxError: EOL while scanning single-quoted string I hit this all the time with Vim's path

Re: Best Practice Question

2013-02-05 Thread Albert Hopkins
[...] > By the way, did someone ever notice that r'\' fails ? I'm sure there's a > reason for that... (python 2.5) Anyone knows ? > > r'\' > SyntaxError: EOL while scanning single-quoted string > > "Even in a raw string, string quotes can be escaped with a backslash, but the backslash remains in

Re: Best Practice Question

2013-02-05 Thread Jean-Michel Pichavant
- Original Message - > On 02/04/2013 11:23 PM, Anthony Correia wrote: > > Just started learning Python. I just wrote a simple copy files > > script. I use Powershell now as my main scripting language but I > > wanted to extend into the linux platform as well. Is this the > > best way to

Re: Best Practice Question

2013-02-05 Thread Dave Angel
On 02/04/2013 11:23 PM, Anthony Correia wrote: Just started learning Python. I just wrote a simple copy files script. I use Powershell now as my main scripting language but I wanted to extend into the linux platform as well. Is this the best way to do it? import os objdir = ("C:\\temp2

Best Practice Question

2013-02-04 Thread Anthony Correia
Just started learning Python. I just wrote a simple copy files script. I use Powershell now as my main scripting language but I wanted to extend into the linux platform as well. Is this the best way to do it? import os objdir = ("C:\\temp2") colDir = os.listdir(objdir) for f in

distutils + mercurial good practice question

2012-02-22 Thread Steven D'Aprano
distutils generates a number of files automatically in my projects, including MANIFEST, build/* and dist/* Is there any reason why I would want or need to track them in mercurial? I currently have this .hgignore file: syntax: glob *.pyc *~ exclude/* build/* dist/* MANIFEST Good practice or b

Re: XML-schema 'best practice' question

2008-09-20 Thread Lorenzo Gatti
Sorry for pressing the send button too fast. On 20 Set, 07:59, Frank Millman <[EMAIL PROTECTED]> wrote: > I want to introduce an element of workflow management (aka Business > Process Management) into the business/accounting system I am > developing. I used google to try to find out what the curr

Re: XML-schema 'best practice' question

2008-09-20 Thread Lorenzo Gatti
On 20 Set, 07:59, Frank Millman <[EMAIL PROTECTED]> wrote: > I want to introduce an element of workflow management (aka Business > Process Management) into the business/accounting system I am > developing. I used google to try to find out what the current state of > the art is. After several month

Re: XML-schema 'best practice' question

2008-09-19 Thread Frank Millman
On Sep 18, 8:28 am, Frank Millman <[EMAIL PROTECTED]> wrote: > Hi all > > This is not strictly a Python question, but as I am writing in Python, > and as I know there are some XML gurus on this list, I hope it is > appropriate here. > > XML-schemas are used to define the structure of an xml documen

Re: XML-schema 'best practice' question

2008-09-18 Thread skip
Frank> 1. Don't use default values - create the document with all values Frank> filled in. Frank> 2. Use python to check for missing values and fill in the defaults Frank> when processing the document. Frank> Or maybe the best practice is to *always* validate a document Fr

Re: XML-schema 'best practice' question

2008-09-18 Thread Lorenzo Gatti
On 18 Set, 08:28, Frank Millman <[EMAIL PROTECTED]> wrote: > I am thinking of adding a check to see if a document has changed since > it was last validated, and if not, skip the validation step. However, > I then do not get the default values filled in. > > I can think of two possible solutions. I

XML-schema 'best practice' question

2008-09-17 Thread Frank Millman
Hi all This is not strictly a Python question, but as I am writing in Python, and as I know there are some XML gurus on this list, I hope it is appropriate here. XML-schemas are used to define the structure of an xml document, and to validate that a particular document conforms to the schema. The