: Chris Angelico
To: python-list@python.org
Sent: Thu, Mar 3, 2022 12:40 pm
Subject: Re: Timezone jokes (was: All permutations from 2 lists)
On Fri, 4 Mar 2022 at 03:29, Tim Chase wrote:
>
> On 2022-03-03 06:27, Grant Edwards wrote:
> > On 2022-03-03, Chris Angelico wrote:
> > &
On Fri, 4 Mar 2022 at 03:29, Tim Chase wrote:
>
> On 2022-03-03 06:27, Grant Edwards wrote:
> > On 2022-03-03, Chris Angelico wrote:
> > > Awww, I was going to make a really bad joke about timezones :)
> >
> > As opposed to all the really good jokes about timezones... ;)
>
> And here I thought yo
It is clear that was not quite your real need.
-Original Message-
From: Larry Martell
To: Avi Gross
Cc: python-list@python.org
Sent: Thu, Mar 3, 2022 9:07 am
Subject: Re: All permutations from 2 lists
On Wed, Mar 2, 2022 at 9:42 PM Avi Gross via Python-list
wrote:
>
>
On 2022-03-03 06:27, Grant Edwards wrote:
> On 2022-03-03, Chris Angelico wrote:
> > Awww, I was going to make a really bad joke about timezones :)
>
> As opposed to all the really good jokes about timezones... ;)
And here I thought you were just Trolling with timezones...
https://en.wikipedi
On 03/03/2022 14:07, Larry Martell wrote:
On Wed, Mar 2, 2022 at 9:42 PM Avi Gross via Python-list
wrote:
Larry,
i waited patiently to see what others will write and perhaps see if you explain
better what you need. You seem to gleefully swat down anything offered. So I am
not tempted to
On 2022-03-03, Chris Angelico wrote:
> On Thu, 3 Mar 2022 at 13:05, gene heskett wrote:
>> I take it back, kmail5 had decided it was a different thread. My bad, no
>> biscuit.
>>
>
> Awww, I was going to make a really bad joke about timezones :)
As opposed to all the really good jokes about time
On Wed, Mar 2, 2022 at 9:42 PM Avi Gross via Python-list
wrote:
>
> Larry,
>
> i waited patiently to see what others will write and perhaps see if you
> explain better what you need. You seem to gleefully swat down anything
> offered. So I am not tempted to engage.
But then you gave in to the t
Larry,
i waited patiently to see what others will write and perhaps see if you explain
better what you need. You seem to gleefully swat down anything offered. So I am
not tempted to engage.
Some later messages suggest you may not be specifying quite what you want. It
sounds like you are asking
On Thu, 3 Mar 2022 at 13:05, gene heskett wrote:
> I take it back, kmail5 had decided it was a different thread. My bad, no
> biscuit.
>
Awww, I was going to make a really bad joke about timezones :)
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On Wednesday, 2 March 2022 10:49:11 EST Larry Martell wrote:
> On Wed, Mar 2, 2022 at 10:26 AM Antoon Pardon
wrote:
> > Op 2/03/2022 om 15:58 schreef Larry Martell:
> > > On Wed, Mar 2, 2022 at 9:37 AM Antoon Pardon
wrote:
> > > If one list is empty I want just the other list. What I am
> >
On Wednesday, 2 March 2022 17:46:49 EST Larry Martell wrote:
> On Wed, Mar 2, 2022 at 5:31 PM Joel Goldstick
wrote:
> > On Wed, Mar 2, 2022 at 5:07 PM Larry Martell
wrote:
> > > On Wed, Mar 2, 2022 at 5:00 PM Cameron Simpson
wrote:
> > > > On 02Mar2022 08:29, Larry Martell
wrote:
> > > > >O
On Wed, Mar 2, 2022 at 5:31 PM Joel Goldstick wrote:
>
> On Wed, Mar 2, 2022 at 5:07 PM Larry Martell wrote:
> >
> > On Wed, Mar 2, 2022 at 5:00 PM Cameron Simpson wrote:
> > >
> > > On 02Mar2022 08:29, Larry Martell wrote:
> > > >On Tue, Mar 1, 2022 at 7:32 PM Rob Cliffe
> > > >wrote:
> > >
On Wed, Mar 2, 2022 at 5:07 PM Larry Martell wrote:
>
> On Wed, Mar 2, 2022 at 5:00 PM Cameron Simpson wrote:
> >
> > On 02Mar2022 08:29, Larry Martell wrote:
> > >On Tue, Mar 1, 2022 at 7:32 PM Rob Cliffe
> > >wrote:
> > >> I think itertools.product is what you need.
> > >> Example program:
>
On Wed, Mar 2, 2022 at 5:00 PM Cameron Simpson wrote:
>
> On 02Mar2022 08:29, Larry Martell wrote:
> >On Tue, Mar 1, 2022 at 7:32 PM Rob Cliffe wrote:
> >> I think itertools.product is what you need.
> >> Example program:
> >>
> >> import itertools
> >> opsys = ["Linux","Windows"]
> >> region =
On 02Mar2022 08:29, Larry Martell wrote:
>On Tue, Mar 1, 2022 at 7:32 PM Rob Cliffe wrote:
>> I think itertools.product is what you need.
>> Example program:
>>
>> import itertools
>> opsys = ["Linux","Windows"]
>> region = ["us-east-1", "us-east-2"]
>> print(list(itertools.product(opsys, region)
Something like this?itertools.product(x or ("",) for x in perm_elems)Out of
curiousity, how might one adapt this if x is not a list but an iterator,
without doing `itertools.product(list(x) or ("",) for x in perm_elems)`?
On Wed, 02 Mar 2022 09:25:42 -0600 antoon.par...@vub.be wrote
I sent this 17hrs ago but I guess it just went through. Apologies for the
redundant comments... On Tue, 01 Mar 2022 18:57:02 -0600
om+pyt...@omajoshi.com wrote For completeness, the itertools solution
(which returns an iterator) is
>>> os = ["Linux","Windows"]
>>> region = ["us-east-
For completeness, the itertools solution (which returns an iterator) is
>>> os = ["Linux","Windows"]
>>> region = ["us-east-1", "us-east-2"]
>>> import itertools
>>> itertools.product(os,region)
>>> list(itertools.product(os,region))
[('Linux', 'us-east-1'), ('Linux', 'us-east-2'), ('Windows', 'u
On Wed, Mar 2, 2022 at 10:26 AM Antoon Pardon wrote:
>
>
>
> Op 2/03/2022 om 15:58 schreef Larry Martell:
> > On Wed, Mar 2, 2022 at 9:37 AM Antoon Pardon wrote:
> >>
> > If one list is empty I want just the other list. What I am doing is
> > building a list to pass to a mongodb query. If
Op 2/03/2022 om 15:58 schreef Larry Martell:
On Wed, Mar 2, 2022 at 9:37 AM Antoon Pardon wrote:
If one list is empty I want just the other list. What I am doing is
building a list to pass to a mongodb query. If region is empty then I
want to query for just the items in the os list. I gues
On Wed, Mar 2, 2022 at 9:37 AM Antoon Pardon wrote:
>
>
>
> Op 2/03/2022 om 15:29 schreef Larry Martell:
> > On Wed, Mar 2, 2022 at 9:10 AM Antoon Pardon wrote:
> >> Op 2/03/2022 om 14:44 schreef Larry Martell:
> >>> On Wed, Mar 2, 2022 at 8:37 AM Antoon Pardon
> >>> wrote:
> Op 2/03/2022
Op 2/03/2022 om 15:29 schreef Larry Martell:
On Wed, Mar 2, 2022 at 9:10 AM Antoon Pardon wrote:
Op 2/03/2022 om 14:44 schreef Larry Martell:
On Wed, Mar 2, 2022 at 8:37 AM Antoon Pardon wrote:
Op 2/03/2022 om 14:27 schreef Larry Martell:
On Tue, Mar 1, 2022 at 7:21 PM<2qdxy4rzwzuui...@
On Wed, Mar 2, 2022 at 9:10 AM Antoon Pardon wrote:
>
> Op 2/03/2022 om 14:44 schreef Larry Martell:
> > On Wed, Mar 2, 2022 at 8:37 AM Antoon Pardon wrote:
> >>
> >> Op 2/03/2022 om 14:27 schreef Larry Martell:
> >>> On Tue, Mar 1, 2022 at 7:21 PM<2qdxy4rzwzuui...@potatochowder.com>
> >>> wro
Op 2/03/2022 om 14:44 schreef Larry Martell:
On Wed, Mar 2, 2022 at 8:37 AM Antoon Pardon wrote:
Op 2/03/2022 om 14:27 schreef Larry Martell:
On Tue, Mar 1, 2022 at 7:21 PM<2qdxy4rzwzuui...@potatochowder.com> wrote:
On 2022-03-01 at 19:12:10 -0500,
Larry Martell wrote:
If I have 2 list
On Wed, Mar 2, 2022 at 9:01 AM Larry Martell wrote:
>
> On Wed, Mar 2, 2022 at 8:54 AM Joel Goldstick
> wrote:
> >
> > On Wed, Mar 2, 2022 at 8:46 AM Larry Martell
> > wrote:
> > >
> > > On Wed, Mar 2, 2022 at 8:37 AM Antoon Pardon wrote:
> > > >
> > > >
> > > > Op 2/03/2022 om 14:27 schreef
On Wed, Mar 2, 2022 at 8:54 AM Joel Goldstick wrote:
>
> On Wed, Mar 2, 2022 at 8:46 AM Larry Martell wrote:
> >
> > On Wed, Mar 2, 2022 at 8:37 AM Antoon Pardon wrote:
> > >
> > >
> > > Op 2/03/2022 om 14:27 schreef Larry Martell:
> > > > On Tue, Mar 1, 2022 at 7:21 PM<2qdxy4rzwzuui...@potatoch
On Wed, Mar 2, 2022 at 8:46 AM Larry Martell wrote:
>
> On Wed, Mar 2, 2022 at 8:37 AM Antoon Pardon wrote:
> >
> >
> > Op 2/03/2022 om 14:27 schreef Larry Martell:
> > > On Tue, Mar 1, 2022 at 7:21 PM<2qdxy4rzwzuui...@potatochowder.com> wrote:
> > >> On 2022-03-01 at 19:12:10 -0500,
> > >> Larr
On Wed, Mar 2, 2022 at 8:37 AM Antoon Pardon wrote:
>
>
> Op 2/03/2022 om 14:27 schreef Larry Martell:
> > On Tue, Mar 1, 2022 at 7:21 PM<2qdxy4rzwzuui...@potatochowder.com> wrote:
> >> On 2022-03-01 at 19:12:10 -0500,
> >> Larry Martell wrote:
> >>
> >>> If I have 2 lists, e.g.:
> >>>
> >>> os
Op 2/03/2022 om 14:27 schreef Larry Martell:
On Tue, Mar 1, 2022 at 7:21 PM<2qdxy4rzwzuui...@potatochowder.com> wrote:
On 2022-03-01 at 19:12:10 -0500,
Larry Martell wrote:
If I have 2 lists, e.g.:
os = ["Linux","Windows"]
region = ["us-east-1", "us-east-2"]
How can I get a list of tuple
On Tue, Mar 1, 2022 at 7:32 PM Rob Cliffe wrote:
>
> I would not use `os` as an identifier, as it is the name of an important
> built-in module.
This is part of a much larger data structure, I created a simplified
example. It is not actually called os.
> I think itertools.product is what you nee
On Tue, Mar 1, 2022 at 7:21 PM <2qdxy4rzwzuui...@potatochowder.com> wrote:
>
> On 2022-03-01 at 19:12:10 -0500,
> Larry Martell wrote:
>
> > If I have 2 lists, e.g.:
> >
> > os = ["Linux","Windows"]
> > region = ["us-east-1", "us-east-2"]
> >
> > How can I get a list of tuples with all possible pe
On Wed, 2 Mar 2022 at 19:34, Peter Otten <__pete...@web.de> wrote:
>
> On 02/03/2022 01:32, Rob Cliffe via Python-list wrote:
>
> > itertools.product returns an iterator (or iterable, I'm not sure of the
> > correct technical term).
>
> There's a simple test:
>
> iter(x) is x --> True # iterator
>
On 02/03/2022 01:32, Rob Cliffe via Python-list wrote:
itertools.product returns an iterator (or iterable, I'm not sure of the
correct technical term).
There's a simple test:
iter(x) is x --> True # iterator
iter(x) is x --> False # iterable
So:
>>> from itertools import product
>>> p =
I would not use `os` as an identifier, as it is the name of an important
built-in module.
I think itertools.product is what you need.
Example program:
import itertools
opsys = ["Linux","Windows"]
region = ["us-east-1", "us-east-2"]
print(list(itertools.product(opsys, region)))
Output:
[('Linux
On 2022-03-01 at 19:12:10 -0500,
Larry Martell wrote:
> If I have 2 lists, e.g.:
>
> os = ["Linux","Windows"]
> region = ["us-east-1", "us-east-2"]
>
> How can I get a list of tuples with all possible permutations?
>
> So for this example I'd want:
>
> [("Linux", "us-east-1"), ("Linux", "us-e
If I have 2 lists, e.g.:
os = ["Linux","Windows"]
region = ["us-east-1", "us-east-2"]
How can I get a list of tuples with all possible permutations?
So for this example I'd want:
[("Linux", "us-east-1"), ("Linux", "us-east-2"), ("Windows",
"us-east-1"), "Windows", "us-east-2')]
The lists can b
36 matches
Mail list logo