Re: Getting Syslog working on OSX Monterey

2022-03-02 Thread Philip Bloom via Python-list
I'm probably asking on the wrong list, and probably should bother wherever apple's ASL experts live for changes in monterey. Guess nobody else is seeing this? The same exact code is working just fine on OSX Big Sur, but on OSX Monterey it doesn't work at all. Users that haven't updated are havi

Re: All permutations from 2 lists

2022-03-02 Thread Avi Gross via Python-list
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

Re: All permutations from 2 lists

2022-03-02 Thread Chris Angelico
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

Re: All permutations from 2 lists

2022-03-02 Thread gene heskett
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 > >

Re: All permutations from 2 lists

2022-03-02 Thread gene heskett
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

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
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: > > >

Re: All permutations from 2 lists

2022-03-02 Thread Joel Goldstick
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: >

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
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 =

Re: All permutations from 2 lists

2022-03-02 Thread Cameron Simpson
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)

Re: lxml empty versus self closed tag

2022-03-02 Thread Dieter Maurer
Robin Becker wrote at 2022-3-2 15:32 +: >I'm using lxml.etree.XMLParser and would like to distinguish > > > >from > > > >I seem to have e.getchildren()==[] and e.text==None for both cases. Is there a >way to get the first to have e.text=='' I do not think so (at least not without a DTD): `' i

Re: All permutations from 2 lists

2022-03-02 Thread Om Joshi
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

Re: All permutations from 2 lists

2022-03-02 Thread Om Joshi
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-

Re: SQLAlchemy: JSON vs. PickleType vs. raw string for serialised data

2022-03-02 Thread Loris Bennett
Dennis Lee Bieber writes: > On Tue, 01 Mar 2022 08:35:05 +0100, Loris Bennett > declaimed the following: > >>Thanks for the various suggestions. The data I need to store is just a >>dict with maybe 3 or 4 keys and short string values probably of less >>than 32 characters each per event. The tr

Re: All permutations from 2 lists

2022-03-02 Thread Om Joshi
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

Re: Timezone for datetime.date objects

2022-03-02 Thread Peter J. Holzer
On 2022-02-28 23:28:23 +0100, Morten W. Petersen wrote: > Well, let's say I specify the datetime 2022-02-22 02:02 (AM). I think > everyone could agree that it also means 2022-02-22 02:02:00:00, to > 2022-02-22 02:02:59:59. I disagree. The datetime 2022-02-22 02:02 specifies a point in time, not a

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
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

lxml empty versus self closed tag

2022-03-02 Thread Robin Becker
I'm using lxml.etree.XMLParser and would like to distinguish from I seem to have e.getchildren()==[] and e.text==None for both cases. Is there a way to get the first to have e.text=='' -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: All permutations from 2 lists

2022-03-02 Thread Antoon Pardon
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

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
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

Re: All permutations from 2 lists

2022-03-02 Thread Antoon Pardon
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...@

Re: All permutations from 2 lists

2022-03-02 Thread 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...@potatochowder.com> > >>> wro

Re: All permutations from 2 lists

2022-03-02 Thread Antoon Pardon
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

Re: All permutations from 2 lists

2022-03-02 Thread Joel Goldstick
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

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
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

Re: All permutations from 2 lists

2022-03-02 Thread Joel Goldstick
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

Re: All permutations from 2 lists

2022-03-02 Thread 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 lists, e.g.: > >>> > >>> os

Re: All permutations from 2 lists

2022-03-02 Thread Antoon Pardon
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

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
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

Re: All permutations from 2 lists

2022-03-02 Thread 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 tuples with all possible pe

Re: All permutations from 2 lists

2022-03-02 Thread Chris Angelico
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 >

Re: All permutations from 2 lists

2022-03-02 Thread Peter Otten
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 =