Re: Understanding the MRO with multiple inheritance

2019-03-29 Thread Arup Rakshit
Hello DL, I am using Python3. Thanks, Arup Rakshit a...@zeit.io > On 30-Mar-2019, at 6:58 AM, DL Neil wrote: > > Arup, > > There is a minefield here. Are you using Python 2 or 3? > > -- > Regards =dn > -- > https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.o

Re: Understanding the MRO with multiple inheritance

2019-03-29 Thread dieter
Arup Rakshit writes: > I basically had defined 4 classes. SimpleList be the base class for all the > other 3 classes. SortedList and IntList both being the child of the base > class SimpleList. They have a single inheritance relationship. Now I have the > last class called SortedIntList which h

Re: Query windows event log with python

2019-03-29 Thread mons . sidus
lol cheeky as. server = 'x' # name of the target computer to get event logs source = 'x' # 'Application' # 'Security' hand = win32evtlog.OpenEventLog(server, source) flags = win32evtlog.EVENTLOG_BACKWARDS_READ | win32evtlog.EVENTLOG_SEQUENTIAL_READ total = win32evtlog.GetNumberOfEventLogRecords

Re: Understanding the MRO with multiple inheritance

2019-03-29 Thread Chris Angelico
On Fri, Mar 29, 2019 at 11:54 PM Arup Rakshit wrote: > > Now when I call the add method on the SortedIntList class’s instance, I was > expecting super.add() call inside the IntList class add method will dispatch > it to the base class SimpleList. But in reality it doesn’t, it rather > forwards

Re: Understanding the MRO with multiple inheritance

2019-03-29 Thread DL Neil
Arup, There is a minefield here. Are you using Python 2 or 3? -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Library for parsing binary structures

2019-03-29 Thread Cameron Simpson
On 30Mar2019 09:44, Cameron Simpson wrote: On 27Mar2019 18:41, Paul Moore wrote: I'm looking for a library that lets me parse binary data structures. The stdlib struct module is fine for simple structures, but when it gets to more complicated cases, you end up doing a lot of the work by hand (

Re: Library for parsing binary structures

2019-03-29 Thread Cameron Simpson
On 27Mar2019 18:41, Paul Moore wrote: I'm looking for a library that lets me parse binary data structures. The stdlib struct module is fine for simple structures, but when it gets to more complicated cases, you end up doing a lot of the work by hand (which isn't that hard, and is generally perfe

Re: Library for parsing binary structures

2019-03-29 Thread Peter J. Holzer
On 2019-03-29 16:34:35 +, Paul Moore wrote: > On Fri, 29 Mar 2019 at 16:16, Peter J. Holzer wrote: > > > Obviously you need some way to describe the specific binary format you > > want to parse - in other words, a grammar. The library could then use > > the grammar to parse the input - either

Re: The Mailing List Digest Project

2019-03-29 Thread Jason Friedman
> > Pretty cool. FYI, the index page (now containing 4 articles) with Google >> Chrome 72.0.3626.x prompts me to translate to French. The articles >> themselves do not. >> > > I'm now getting the translation offer on other web pages with Chrome, not just this one. Thus, please ignore my prior po

Re: Library for parsing binary structures

2019-03-29 Thread Paul Moore
On Fri, 29 Mar 2019 at 16:16, Peter J. Holzer wrote: > Obviously you need some way to describe the specific binary format you > want to parse - in other words, a grammar. The library could then use > the grammar to parse the input - either by interpreting it directly, or > by generating (Python)

Re: Library for parsing binary structures

2019-03-29 Thread Dan Sommers
On 3/29/19 12:13 PM, Peter J. Holzer wrote: Obviously you need some way to describe the specific binary format you want to parse - in other words, a grammar. The library could then use the grammar to parse the input - either by interpreting it directly, or by generating (Python) code from it. Th

Re: Library for parsing binary structures

2019-03-29 Thread Peter J. Holzer
On 2019-03-28 11:07:22 +0100, dieter wrote: > Paul Moore writes: > > My real interest is in whether any libraries exist to do this sort > > of thing (there are plenty of parser libraries for text, pyparsing > > being the obvious one, but far fewer for binary structures). > > Sure. *BUT* the libra

Re: Handy utilities = Friday Filosofical Finking

2019-03-29 Thread Akkana Peck
DL Neil writes: > How do you keep, use, and maintain those handy snippets, functions, > classes... - units of code, which you employ over-and-over again? Fun topic! I have two methods: First, in my scripts directory I have a file called "python-cheatsheet.py" where I save small tips that I think

Re: Jinja and non-ASCII characters (was Re: Prepare accented characters for HTML)

2019-03-29 Thread Peter Otten
Peter J. Holzer wrote: > On 2019-03-29 12:56:00 +0100, Thomas Jollans wrote: >> On 29/03/2019 12.39, Tony van der Hoff wrote: >> > Running in browser: >> > http://localhost/~tony/private/home/learning/jinja/minimal/minimal.py >> > >> > In apache2.access.log: >> >> So it's running in apache! >>

Re: Jinja and non-ASCII characters (was Re: Prepare accented characters for HTML)

2019-03-29 Thread Peter J. Holzer
On 2019-03-29 12:56:00 +0100, Thomas Jollans wrote: > On 29/03/2019 12.39, Tony van der Hoff wrote: > > Running in browser: > > http://localhost/~tony/private/home/learning/jinja/minimal/minimal.py > > > > In apache2.access.log: > > So it's running in apache! > > Now the question is what apache

Re: Handy utilities = Friday Filosofical Finking

2019-03-29 Thread Neil Cerutti
On 2019-03-28, DL Neil wrote: > How do you keep, use, and maintain those handy snippets, > functions, classes... - units of code, which you employ > over-and-over again? > > Having coded 'stuff' once, most of us will keep units of code, > "utilities", which we expect will be useful in-future (DRY

Understanding the MRO with multiple inheritance

2019-03-29 Thread Arup Rakshit
I basically had defined 4 classes. SimpleList be the base class for all the other 3 classes. SortedList and IntList both being the child of the base class SimpleList. They have a single inheritance relationship. Now I have the last class called SortedIntList which has multiple inheritance relati

Re: Jinja and non-ASCII characters (was Re: Prepare accented characters for HTML)

2019-03-29 Thread Thomas Jollans
On 29/03/2019 12.39, Tony van der Hoff wrote: > On 29/03/2019 11:08, Chris Angelico wrote: >> On Fri, Mar 29, 2019 at 9:12 PM Tony van der Hoff >> wrote: >>> >>> Hello Chris. >>> Thanks for your interest. >>> >>> On 28/03/2019 18:04, Chris Angelico wrote: On Fri, Mar 29, 2019 at 4:10 AM Tony

Re: Jinja and non-ASCII characters (was Re: Prepare accented characters for HTML)

2019-03-29 Thread Tony van der Hoff
On 29/03/2019 11:08, Chris Angelico wrote: > On Fri, Mar 29, 2019 at 9:12 PM Tony van der Hoff > wrote: >> >> Hello Chris. >> Thanks for your interest. >> >> On 28/03/2019 18:04, Chris Angelico wrote: >>> On Fri, Mar 29, 2019 at 4:10 AM Tony van der Hoff >>> wrote: This'll probably wo

Re: Jinja and non-ASCII characters (was Re: Prepare accented characters for HTML)

2019-03-29 Thread Chris Angelico
On Fri, Mar 29, 2019 at 9:12 PM Tony van der Hoff wrote: > > Hello Chris. > Thanks for your interest. > > On 28/03/2019 18:04, Chris Angelico wrote: > > On Fri, Mar 29, 2019 at 4:10 AM Tony van der Hoff > > wrote: > >> > >> This'll probably work: > > > > You have a python3 shebang, but are you d

Re: Jinja and non-ASCII characters (was Re: Prepare accented characters for HTML)

2019-03-29 Thread Thomas Jollans
On 29/03/2019 11.10, Tony van der Hoff wrote: > and running it in a browser (tried both chrome and Firefox), How? > it fails as before: blank web page. No traceback? There must be a traceback somewhere. In a log file perhaps. -- https://mail.python.org/mailman/listinfo/python-list

Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-29 Thread Antoon Pardon
On 27/03/19 09:21, Alexey Muranov wrote: > Whey you need a simple function in Python, there is a choice between a > normal function declaration and an assignment of a anonymous function > (defined by a lambda-expression) to a variable: > >    def f(x): return x*x > > or > >    f = lambda x: x*x > >

Re: Jinja and non-ASCII characters (was Re: Prepare accented characters for HTML)

2019-03-29 Thread Tony van der Hoff
Hello Chris. Thanks for your interest. On 28/03/2019 18:04, Chris Angelico wrote: > On Fri, Mar 29, 2019 at 4:10 AM Tony van der Hoff > wrote: >> >> This'll probably work: > > You have a python3 shebang, but are you definitely running this under Python > 3? > Absolutely. > Here's a much more

Re: Levenberg-Marquardt non-linear least-squares fitting in Python [follow-on]

2019-03-29 Thread edmondo . giovannozzi
> ltemp = [ydata[i] - ydata[0] for i in range(ll)] > ytemp = [ltemp[i] * .001 for i in range(ll)] > ltemp = [xdata[i] - xdata[0] for i in range(ll)] > xtemp = [ltemp[i] * .001 for i in range(ll)] Use the vectorization given by numpy: ytemp = (ydata - ydata[0]) * 0.001