On Mar 23, 12:22 pm, Lie <[EMAIL PROTECTED]> wrote:
> On Mar 22, 2:23 pm, [EMAIL PROTECTED] wrote:
>
> > > Sane programmers don't write such semi-functional things (unless it
> > > helps expressing the problem in certain domains).
> > > I now think that deprecating map, lambda & Co. was a good thin
On Mar 22, 2:23 pm, [EMAIL PROTECTED] wrote:
> > Sane programmers don't write such semi-functional things (unless it
> > helps expressing the problem in certain domains).
> > I now think that deprecating map, lambda & Co. was a good thing after
> > all.
>
> If you write it that way the first time,
On Mar 20, 1:06 pm, royG <[EMAIL PROTECTED]> wrote:
> hi
> i am trying to resize some images.First i'd read the size as a 2
> tuple and then i want to divide it by 2 or 4 or 2.5 etc..
>
> suppose
> origsz=(400,300)
> i want to divide the origsize by 2.5 so i can resize to (160,120)
There are seve
On Mar 21, 1:08 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> Sane programmers replace that crazyness with this code:
>
> tuple(x+1 for x in y)
>
> Sane programmers -like D'Aprano, Jerry Hill and me- replace that
> crazyness with this code:
>
> tuple(x/2.5 for x in y)
>
> Sane programmers don'
On 21 mar, 10:14, [EMAIL PROTECTED] wrote:
> On Mar 20, 9:28 am, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
> > A more general
> > solution might use a generator expression, like this:
> > newsz = tuple(x/scale for x in origsz)
>
> You want to perform a uniform call on the elements of a collection.
>
On Mar 21, 8:14 am, [EMAIL PROTECTED] wrote:
> On Mar 20, 9:28 am, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
> > On Thu, Mar 20, 2008 at 3:42 AM, Steven D'Aprano
> > <[EMAIL PROTECTED]> wrote:
> > > On Wed, 19 Mar 2008 23:06:44 -0700, royG wrote:
>
> > > > suppose
> > > > origsz=(400,300)
> > > >
On Mar 20, 9:28 am, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
> On Thu, Mar 20, 2008 at 3:42 AM, Steven D'Aprano
>
> <[EMAIL PROTECTED]> wrote:
> > On Wed, 19 Mar 2008 23:06:44 -0700, royG wrote:
>
> > > suppose
> > > origsz=(400,300)
> > > i want to divide the origsize by 2.5 so i can resize to (
On Thu, Mar 20, 2008 at 3:42 AM, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Wed, 19 Mar 2008 23:06:44 -0700, royG wrote:
>
>
> > suppose
> > origsz=(400,300)
> > i want to divide the origsize by 2.5 so i can resize to (160,120)
> >
> > scale=2.5
> > how can i get the newsz?
> > obviousl
On Wed, 19 Mar 2008 23:06:44 -0700, royG wrote:
> suppose
> origsz=(400,300)
> i want to divide the origsize by 2.5 so i can resize to (160,120)
>
> scale=2.5
> how can i get the newsz?
> obviously origsz/2.5 won't work ..
newsz = (origsz[0]/scale, origsz[1]/scale)
--
Steven
--
http://ma