Re: Modifying every alternate element of a sequence

2006-11-28 Thread John Hicken
= [v - 2*(i % 2) for (i,v) in enumerate(input)] That looks less clear to me than your version, though. John Hicken -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator question

2006-09-26 Thread John Hicken
Neal Becker wrote: > Any suggestions for transforming the sequence: > > [1, 2, 3, 4...] > Where 1,2,3.. are it the ith item in an arbitrary sequence > > into a succession of tuples: > > [(1, 2), (3, 4)...] > > In other words, given a seq and an integer that specifies the size of tuple > to return,

Re: Size of hard drive and Mp3 tags functions

2006-07-09 Thread John Hicken
Dennis Lee Bieber wrote: > On 9 Jul 2006 11:14:25 -0700, "John Hicken" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > Anyway, there are two sorts of functions that could be useful. > > 1) A function that gives the size of a hard

Size of hard drive and Mp3 tags functions

2006-07-09 Thread John Hicken
tself), and/or the space remaining. 2)A function/functions to read the ID tags of an MP3 file. Doesn't anyone here know if functions like that exist for Python? Ideally these would be built-in functions, or in the modules that come with Python. This is for Windows by the way. John Hicken

Re: urllib behaves strangely

2006-06-12 Thread John Hicken
It might be that Wikimedia Commons blocks bots that aren't approved, and might consider your program a bot. I've had similar error message from www.wikipedia.org and had no problems with a couple of other websites I've tried. Also, the html the program returns seems to be a st