Re: Syntax not understood

2021-11-04 Thread Chris Angelico
On Fri, Nov 5, 2021 at 6:45 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > > But since it says "box", I would start by assuming that it has four > > elements. (They might be x1,y1,x2,y2 or x,y,w,h but it'll almost > > always be four.) So it's not TOO fragile, when working with boxes, but > > it i

Re: Syntax not understood

2021-11-04 Thread 2QdxY4RzWzUUiLuE
On 2021-11-05 at 06:28:34 +1100, Chris Angelico wrote: > On Fri, Nov 5, 2021 at 6:23 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > On 2021-11-04 at 14:36:48 -0400, > > David Lowry-Duda wrote: > > > > > > x_increment, y_increment = (scale * i for i in srcpages.xobj_box[2:]) > > > > > > >

Re: Syntax not understood

2021-11-04 Thread Chris Angelico
On Fri, Nov 5, 2021 at 6:23 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2021-11-04 at 14:36:48 -0400, > David Lowry-Duda wrote: > > > > x_increment, y_increment = (scale * i for i in srcpages.xobj_box[2:]) > > > > > > (scale * i for i in srcpages.xobj_box[2:]) is a generator, a single >

Re: Syntax not understood

2021-11-04 Thread 2QdxY4RzWzUUiLuE
On 2021-11-04 at 14:36:48 -0400, David Lowry-Duda wrote: > > x_increment, y_increment = (scale * i for i in srcpages.xobj_box[2:]) > > > > (scale * i for i in srcpages.xobj_box[2:]) is a generator, a single > > object, it should not be possible to unpack it into 2 variables. > > If you know the

Re: Syntax not understood

2021-11-04 Thread David Lowry-Duda
> x_increment, y_increment = (scale * i for i in srcpages.xobj_box[2:]) > > (scale * i for i in srcpages.xobj_box[2:]) is a generator, a single > object, it should not be possible to unpack it into 2 variables. If you know the exact number of values in the generator, you can do this. Here is an

Re: Syntax not understood

2021-11-04 Thread ast
Le 04/11/2021 à 16:41, Stefan Ram a écrit : ast writes: (scale * i for i in srcpages.xobj_box[2:]) is a generator, a single object, it should not be possible to unpack it into 2 variables. But the value of the right-hand side /always/ is a single object! A syntax of an assignment state

Syntax not understood

2021-11-04 Thread ast
Hello In this function def get4(srcpages): scale = 0.5 srcpages = PageMerge() + srcpages x_increment, y_increment = (scale * i for i in srcpages.xobj_box[2:]) for i, page in enumerate(srcpages): page.scale(scale) page.x = x_increment if i & 1 else 0 page.y