Re: Prepare accented characters for HTML

2019-03-28 Thread dieter
Tony van der Hoff writes: > I have a MariaDB database, which contains accented (mostly French) > characters. I need to display these on an HTML page. I'm using the Jinja > templating engine. Why do you (still) need this? HTML is prepared to work all over the world - even in Asia where few charact

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

2019-03-28 Thread William Ray Wing via Python-list
Below I’ve included the code I ran, reasonably (I think) commented. Note the reference to the example. The data actually came from a pandas data frame that was in turn filled from a 100 MB data file that included lots of other data not needed for this, which was a curve fit to a calibration ru

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

2019-03-28 Thread Terry Reedy
On 3/28/2019 12:29 PM, Alexey Muranov wrote: On jeu., Mar 28, 2019 at 5:00 PM, python-list-requ...@python.org wrote: So my opinion is that lambda expressions should only be used within larger expressions and never directly bound. It would be however more convenient to be able to write inste

Re: Getting file extensions [linux fs]

2019-03-28 Thread Cameron Simpson
On 28Mar2019 01:12, Paulo da Silva wrote: Às 23:09 de 27/03/19, Cameron Simpson escreveu: On 27Mar2019 21:49, Paulo da Silva wrote: ... The filefrag manual entry says it works by calling one of 2 ioctls. You can do that from Python with the ioctl() function in the standard fcntl module. I ha

Re: Handy utilities = Friday Filosofical Finking

2019-03-28 Thread Test Bot
+1 On Fri, Mar 29, 2019, 2:04 AM 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 us

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

2019-03-28 Thread Chris Angelico
On Fri, Mar 29, 2019 at 7:29 AM Alexey Muranov wrote: > My idea however was to have it as an exact synonyme of an assignment of > a lambda. Assignment is an assignment, it should not modify the > attributs of the value that is being assigned. Assigning lambda functions to names generally shouldn'

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

2019-03-28 Thread Ian Kelly
On Thu, Mar 28, 2019 at 2:30 PM Alexey Muranov wrote: > > On jeu., mars 28, 2019 at 8:57 PM, Terry Reedy wrote: > > Throwing the name away is foolish. Testing functions is another > > situation in which function names are needed for proper report. > > My idea however was to have it as an exact s

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

2019-03-28 Thread Alexey Muranov
On jeu., mars 28, 2019 at 5:00 PM, python-list-requ...@python.org wrote: So documentation of that syntax would 100% be required Regarding documentation, i believe there would be 3 line to add: () = is a syntactic sugar for = lambda : Alexey. -- https://mail.python.org/mailman

Handy utilities = Friday Filosofical Finking

2019-03-28 Thread DL Neil
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 principle), eg functions to rename fi

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

2019-03-28 Thread Alexey Muranov
On jeu., mars 28, 2019 at 8:57 PM, Terry Reedy wrote: On 3/28/2019 12:29 PM, Alexey Muranov wrote: On jeu., Mar 28, 2019 at 5:00 PM, python-list-requ...@python.org wrote: So my opinion is that lambda expressions should only be used within larger expressions and never directly bound. It w

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

2019-03-28 Thread Alexey Muranov
On jeu., mars 28, 2019 at 8:57 PM, Terry Reedy wrote: But i see your point about never assigning lambdas directly, it makes sense. But sometimes i do assign short lambdas directly to variable. Is the convenience and (very low) frequency of applicability worth the inconvenience of confu

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

2019-03-28 Thread Alexey Muranov
On jeu., mars 28, 2019 at 5:00 PM, python-list-requ...@python.org wrote: On 2019-03-27 10:42 a.m., Paul Moore wrote: On Wed, 27 Mar 2019 at 12:27, Alexey Muranov wrote: On mer., mars 27, 2019 at 10:10 AM, Paul Moore wrote: On Wed, 27 Mar 2019 at 08:25, Alexey Muranov wrote: Whey yo

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

2019-03-28 Thread Chris Angelico
On Fri, Mar 29, 2019 at 4:10 AM Tony van der Hoff wrote: > > This'll probably work: > > accent-test/accent-test.py: > # > #!/usr/bin/env python3 > > import os > from jinja2 import Environment, FileSystemLoader > > PATH = os.path.d

Re: Prepare accented characters for HTML

2019-03-28 Thread Peter Otten
Tony van der Hoff wrote: > On 28/03/2019 16:58, Chris Angelico wrote: >> On Fri, Mar 29, 2019 at 3:47 AM Tony van der Hoff >> wrote: >>> >>> On 28/03/2019 15:09, Peter Otten wrote: Tony van der Hoff wrote: > On 28/03/2019 12:46, Jon Ribbens wrote: >> On 2019-03-28, Tony van der

Re: Prepare accented characters for HTML

2019-03-28 Thread Tony van der Hoff
On 28/03/2019 16:58, Chris Angelico wrote: > On Fri, Mar 29, 2019 at 3:47 AM Tony van der Hoff > wrote: >> >> On 28/03/2019 15:09, Peter Otten wrote: >>> Tony van der Hoff wrote: >>> On 28/03/2019 12:46, Jon Ribbens wrote: > On 2019-03-28, Tony van der Hoff wrote: >> Thanks, Chris.

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

2019-03-28 Thread Ian Kelly
On Wed, Mar 27, 2019 at 3:13 AM Paul Moore wrote: > > On Wed, 27 Mar 2019 at 08:25, 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) t

Re: Prepare accented characters for HTML

2019-03-28 Thread Chris Angelico
On Fri, Mar 29, 2019 at 3:47 AM Tony van der Hoff wrote: > > On 28/03/2019 15:09, Peter Otten wrote: > > Tony van der Hoff wrote: > > > >> On 28/03/2019 12:46, Jon Ribbens wrote: > >>> On 2019-03-28, Tony van der Hoff wrote: > Thanks, Chris. The problem is not with the browser, but Jinja cra

Re: Prepare accented characters for HTML

2019-03-28 Thread Tony van der Hoff
On 28/03/2019 15:09, Peter Otten wrote: > Tony van der Hoff wrote: > >> On 28/03/2019 12:46, Jon Ribbens wrote: >>> On 2019-03-28, Tony van der Hoff wrote: Thanks, Chris. The problem is not with the browser, but Jinja crashes. Probably a bug, but I'm too wedded to that engine to change

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

2019-03-28 Thread Alexey Muranov
On jeu., Mar 28, 2019 at 5:00 PM, python-list-requ...@python.org wrote: So my opinion is that lambda expressions should only be used within larger expressions and never directly bound. It would be however more convenient to be able to write instead just f(x) = x*x Given my view above,

Re: Levenberg-Marquardt non-linear least-squares fitting in Python

2019-03-28 Thread Madhavan Bomidi
Hi Bill, Thanks for your suggestion. Where am I actually using the curve_fit in the defined function func2fit? Don't I need to initial assumption of a, b and c values so that optimized convergence occur with iteration of the function for the input data of x? Look forward to your suggestions, M

Re: Prepare accented characters for HTML

2019-03-28 Thread Peter Otten
Tony van der Hoff wrote: > On 28/03/2019 12:46, Jon Ribbens wrote: >> On 2019-03-28, Tony van der Hoff wrote: >>> Thanks, Chris. The problem is not with the browser, but Jinja crashes. >>> Probably a bug, but I'm too wedded to that engine to change now. I'll >>> raise it on the Jinja bug site. >>

Re: Prepare accented characters for HTML

2019-03-28 Thread Tony van der Hoff
On 28/03/2019 12:46, Jon Ribbens wrote: > On 2019-03-28, Tony van der Hoff wrote: >> Thanks, Chris. The problem is not with the browser, but Jinja crashes. >> Probably a bug, but I'm too wedded to that engine to change now. I'll >> raise it on the Jinja bug site. > > It'll almost certainly be a m

Re: Levenberg-Marquardt non-linear least-squares fitting in Python

2019-03-28 Thread William Ray Wing via Python-list
> On Mar 28, 2019, at 7:54 AM, Madhavan Bomidi wrote: > > Hi, > > I have x and y variables data arrays. These two variables are assumed to be > related as y = A * exp(x/B). Now, I wanted to use Levenberg-Marquardt > non-linear least-squares fitting to find A and B for the best fit of the >

Re: Prepare accented characters for HTML

2019-03-28 Thread Richard Damon
> On Mar 28, 2019, at 7:53 AM, Tony van der Hoff wrote: > Thanks, Chris. The problem is not with the browser, but Jinja crashes. > Probably a bug, but I'm too wedded to that engine to change now. I'll > raise it on the Jinja bug site. > Using Google, it says that Jinja2 is Unicode capable, if

Re: Prepare accented characters for HTML

2019-03-28 Thread Jon Ribbens
On 2019-03-28, Tony van der Hoff wrote: > Thanks, Chris. The problem is not with the browser, but Jinja crashes. > Probably a bug, but I'm too wedded to that engine to change now. I'll > raise it on the Jinja bug site. It'll almost certainly be a mistake in the way you're using Jinja. I can't bel

Re: Prepare accented characters for HTML

2019-03-28 Thread Chris Angelico
On Thu, Mar 28, 2019 at 10:55 PM Tony van der Hoff wrote: > > On 28/03/2019 11:02, Chris Angelico wrote: > > On Thu, Mar 28, 2019 at 8:58 PM Tony van der Hoff > > wrote: > >> > >> Hi, > >> > >> I have a MariaDB database, which contains accented (mostly French) > >> characters. I need to display

Levenberg-Marquardt non-linear least-squares fitting in Python

2019-03-28 Thread Madhavan Bomidi
Hi, I have x and y variables data arrays. These two variables are assumed to be related as y = A * exp(x/B). Now, I wanted to use Levenberg-Marquardt non-linear least-squares fitting to find A and B for the best fit of the data. Can anyone suggest me how I can proceed with the same. My intentio

Re: Prepare accented characters for HTML

2019-03-28 Thread Tony van der Hoff
On 28/03/2019 11:02, Chris Angelico wrote: > On Thu, Mar 28, 2019 at 8:58 PM Tony van der Hoff > wrote: >> >> Hi, >> >> I have a MariaDB database, which contains accented (mostly French) >> characters. I need to display these on an HTML page. I'm using the Jinja >> templating engine. >> >> So, fo

Re: Prepare accented characters for HTML

2019-03-28 Thread Tony van der Hoff
On 28/03/2019 10:19, Antoon Pardon wrote: > On 28/03/19 10:38, Tony van der Hoff wrote: >> Hi, >> >> I have a MariaDB database, which contains accented (mostly French) >> characters. I need to display these on an HTML page. I'm using the Jinja >> templating engine. >> >> So, for instance, é needs t

Regarding 3D buttons in PyQT5

2019-03-28 Thread Vaibhav Kumar
Hi, I want to know that how can i create 3D buttons in PyQT5 window or an animated button. Regards Vaibhav -- https://mail.python.org/mailman/listinfo/python-list

Re: Prepare accented characters for HTML

2019-03-28 Thread Chris Angelico
On Thu, Mar 28, 2019 at 8:58 PM Tony van der Hoff wrote: > > Hi, > > I have a MariaDB database, which contains accented (mostly French) > characters. I need to display these on an HTML page. I'm using the Jinja > templating engine. > > So, for instance, é needs to be replaced by é and so on. I've

Re: Prepare accented characters for HTML

2019-03-28 Thread Antoon Pardon
On 28/03/19 10:38, Tony van der Hoff wrote: > Hi, > > I have a MariaDB database, which contains accented (mostly French) > characters. I need to display these on an HTML page. I'm using the Jinja > templating engine. > > So, for instance, é needs to be replaced by é and so on. I've had > some succe

Re: Library for parsing binary structures

2019-03-28 Thread dieter
Paul Moore writes: > On Thu, 28 Mar 2019 at 08:15, dieter wrote: > ... > 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

Prepare accented characters for HTML

2019-03-28 Thread Tony van der Hoff
Hi, I have a MariaDB database, which contains accented (mostly French) characters. I need to display these on an HTML page. I'm using the Jinja templating engine. So, for instance, é needs to be replaced by é and so on. I've had some success using string.replace(), but it is difficult to cater fo

Re: embedding python - PyImport_ImportModule returns null

2019-03-28 Thread babita . trial
If nothing works mentioned above, please try building your application from common path. ( not from c:\users\ ). While working on office environment, this has impact. -- https://mail.python.org/mailman/listinfo/python-list

Re: Library for parsing binary structures

2019-03-28 Thread Paul Moore
On Thu, 28 Mar 2019 at 08:15, dieter wrote: > What you have is a generalized deserialization problem. > It can be solved with a set of deserializers. Yes, and thanks for the suggested code structure. As I say, I can certainly do the parsing "by hand", and the way you describe is very similar to h

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

2019-03-28 Thread Antoon Pardon
On 27/03/19 22:25, Terry Reedy wrote: > ... > > Before 3.8, I would stop here and say no to the proposal.  But we now > have assignment expressions in addition to assignment statements. > > >>> int(s:='42'+'742') > 42742 > >>> s > '42742' > > To me, function assignment expressions, as a enhanced re

Re: Library for parsing binary structures

2019-03-28 Thread dieter
Paul Moore writes: > 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 perfectly viable,