Re: [Tutor] conditionals with slicing not seeming to work

2008-01-28 Thread Alan Gauld
"Rob Stevenson" <[EMAIL PROTECTED]> wrote > I'm working at a certain website's puzzles using > python in order to learn the language, OK, Then I'll add some other comments > the intention of this snippet is to only print slices where > character 1 is > lower case, 2-4 and 6-8 are upper. The lo

Re: [Tutor] replacing range with xrange

2008-01-28 Thread Tim Golden
Andy Cheesman wrote: > Hi people, > > After watching a nice Google video on Python 3K, and seeing the > forthcoming removal of range, I've looked at substitution range with > xrange within my code. Direct substitution works for 90% percent of the > case (i.e. for thing in xrange(number): ),

[Tutor] replacing range with xrange

2008-01-28 Thread Andy Cheesman
Hi people, After watching a nice Google video on Python 3K, and seeing the forthcoming removal of range, I've looked at substitution range with xrange within my code. Direct substitution works for 90% percent of the case (i.e. for thing in xrange(number): ), however i can't change the examp

Re: [Tutor] conditionals with slicing not seeming to work

2008-01-28 Thread Ricardo Aráoz
Alan Gauld wrote: > "Rob Stevenson" <[EMAIL PROTECTED]> wrote > >> I'm working at a certain website's puzzles using >> python in order to learn the language, > > OK, Then I'll add some other comments > >> the intention of this snippet is to only print slices where >> character 1 is >> lower cas

Re: [Tutor] replacing range with xrange

2008-01-28 Thread Kent Johnson
Andy Cheesman wrote: > After watching a nice Google video on Python 3K, and seeing the > forthcoming removal of range, I've looked at substitution range with > xrange within my code. Direct substitution works for 90% percent of the > case (i.e. for thing in xrange(number): ), however i can't

Re: [Tutor] replacing range with xrange

2008-01-28 Thread bob gailer
Kent Johnson wrote: > bob gailer wrote: > > >> I disagree based on PEP 3100 (http://www.python.org/dev/peps/pep-3100/) >> >> Built-in Namespace: >> - Make built-ins return an iterator where appropriate (e.g. range(), >> zip(), map(), filter(), etc.) >> >> To be removed: >> - xrange(): use range

Re: [Tutor] replacing range with xrange

2008-01-28 Thread bob gailer
Andy Cheesman wrote: > Hi people, > > After watching a nice Google video on Python 3K, and seeing the > forthcoming removal of range, I disagree based on PEP 3100 (http://www.python.org/dev/peps/pep-3100/) Built-in Namespace: - Make built-ins return an iterator where appropriate (e.g. range(),

Re: [Tutor] replacing range with xrange

2008-01-28 Thread Kent Johnson
bob gailer wrote: > I disagree based on PEP 3100 (http://www.python.org/dev/peps/pep-3100/) > > Built-in Namespace: > - Make built-ins return an iterator where appropriate (e.g. range(), > zip(), map(), filter(), etc.) > > To be removed: > - xrange(): use range() instead Right, that's a good c

Re: [Tutor] replacing range with xrange

2008-01-28 Thread Alan Gauld
> xrange() is being renamed to range(), so there will be no xrange() > and > range() will return an iterator rather than a list. That's sad to see, I use range to generate lists of integers almost as much as I use it for iteration. But maybe I'm unusual in that respect, I do use Python mainly for

Re: [Tutor] replacing range with xrange

2008-01-28 Thread bob gailer
Alan Gauld wrote: >> xrange() is being renamed to range(), so there will be no xrange() >> and >> range() will return an iterator rather than a list. >> > > That's sad to see, I use range to generate lists of integers > almost as much as I use it for iteration. But maybe I'm > unusual in that

Re: [Tutor] data structure question

2008-01-28 Thread Alexander
Thanks for all the responses. I'm using this both as an opportunity to learn and to create something that does exactly what I want it to so that's why I want to write my own program. I decided to go with a flat list in the end. Now I have a working implementation but it's not as nice as I think it

[Tutor] What web framework?

2008-01-28 Thread Terry Carroll
I'm writing a pretty small database program. It tracks CDROMs with archives of, say, MP3 files; although I'm writing it with an eye to to generalize to, for example, support a collection of image files, or actual audio CDs, as well; or just about any types of files that might lend themselves to

Re: [Tutor] replacing range with xrange

2008-01-28 Thread Alan Gauld
"bob gailer" <[EMAIL PROTECTED]> wrote >> That's sad to see, I use range to generate lists of integers >> almost as much as I use it for iteration. > FWIW on my computer > l = range(3000) takes under 0.19 seconds > l = list(xrange(300)) under 0.27. > So I don't think performance is an i

Re: [Tutor] What web framework?

2008-01-28 Thread Alan Gauld
"Terry Carroll" <[EMAIL PROTECTED]> wrote > But querying's different. I'd initially planed on making this a > wxPython > application, but I think it might be simpler to have it as a web > app, even > though I'll be the only user, and the db will be resident on the > same > program I'm querying

Re: [Tutor] What web framework?

2008-01-28 Thread Kent Johnson
Terry Carroll wrote: > Any thoughts on these two frameworks, or another that I might be > overlooking? Oh, since I don't know enough about frameworks to even know > what factors are worth considering: what factors would I be considering? TG and Django both work well, and both have many satisfie