Re: =- and -= snag

2023-03-15 Thread Morten W. Petersen
ke that detects this. Regards, Morten On Wed, Mar 15, 2023 at 5:32 AM Gilmeh Serda wrote: > On Mon, 13 Mar 2023 22:26:20 +0100, Morten W. Petersen wrote: > > > numbers for calculations didn't add up. It went into negative numbers, > > when that shouldn't have been

Re: =- and -= snag

2023-03-14 Thread Morten W. Petersen
were so similar. -Morten On Tue, Mar 14, 2023 at 5:31 PM Jon Ribbens via Python-list < python-list@python.org> wrote: > On 2023-03-13, Morten W. Petersen wrote: > > I was working in Python today, and sat there scratching my head as the > > numbers for calculations di

=- and -= snag

2023-03-13 Thread Morten W. Petersen
make a mistake like that? Regards, Morten -- I am https://leavingnorway.info Videos at https://www.youtube.com/user/TheBlogologue Twittering at http://twitter.com/blogologue Blogging at http://blogologue.com Playing music at https://soundcloud.com/morten-w-petersen Also playing music and podcas

Re: Simple TCP proxy

2022-07-31 Thread Morten W. Petersen
ds, Morten On Sat, Jul 30, 2022 at 10:31 PM Barry wrote: > > > > > On 30 Jul 2022, at 20:33, Morten W. Petersen wrote: > > I thought it was a bit much. > > > > I just did a bit more testing, and saw that the throughput of wget > through > > regular light

Re: Simple TCP proxy

2022-07-30 Thread Morten W. Petersen
egant solution. I'm looking for good enough, and in the process I don't mind pushing the envelope on Python threading. -Morten On Sat, Jul 30, 2022 at 12:59 PM Roel Schroeven wrote: > Morten W. Petersen schreef op 29/07/2022 om 22:59: > > OK, sounds like sunshine is getting the

Re: Simple TCP proxy

2022-07-29 Thread Morten W. Petersen
i, Jul 29, 2022 at 10:46 PM Chris Angelico wrote: > On Sat, 30 Jul 2022 at 04:54, Morten W. Petersen > wrote: > > > > OK. > > > > Well, I've worked with web hosting in the past, and proxies like squid > were used to lessen the load on dynamic backends. Ther

Re: Simple TCP proxy

2022-07-29 Thread Morten W. Petersen
, 2022 at 12:11 AM Chris Angelico wrote: > On Fri, 29 Jul 2022 at 07:24, Morten W. Petersen > wrote: > > > > Forwarding to the list as well. > > > > -- Forwarded message - > > From: Morten W. Petersen > > Date: Thu, Jul 28, 2022 at 11:22

Re: Simple TCP proxy

2022-07-29 Thread Morten W. Petersen
tube.com/user/TheBlogologue Twittering at http://twitter.com/blogologue Blogging at http://blogologue.com Playing music at https://soundcloud.com/morten-w-petersen Also playing music and podcasting here: http://www.mixcloud.com/morten-w-petersen/ On Google+ here https://plus.google.com/107781930037068750156 On Instagram at https://instagram.com/morphexx/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple TCP proxy

2022-07-28 Thread Morten W. Petersen
it of money. And people like that might also not always be available. -Morten On Thu, Jul 28, 2022 at 2:29 PM Barry wrote: > > > On 28 Jul 2022, at 10:31, Morten W. Petersen wrote: > >  > Hi Barry. > > Well, I can agree that using backlog is an option for handling burst

Fwd: Simple TCP proxy

2022-07-28 Thread Morten W. Petersen
Forwarding to the list as well. -- Forwarded message - From: Morten W. Petersen Date: Thu, Jul 28, 2022 at 11:22 PM Subject: Re: Simple TCP proxy To: Chris Angelico Well, an increase from 0.1 seconds to 0.2 seconds on "polling" in each thread whether or not the

Re: Simple TCP proxy

2022-07-28 Thread Morten W. Petersen
it's nice to see Python handling 500+ threads without problems. :) -Morten On Thu, Jul 28, 2022 at 11:45 AM Chris Angelico wrote: > On Thu, 28 Jul 2022 at 19:41, Morten W. Petersen > wrote: > > > > Hi Martin. > > > > I was thinking of doing something with the h

Re: Simple TCP proxy

2022-07-28 Thread Morten W. Petersen
aimed at one task, will make it easier to manage even complex matters such as concurrency and threads. -Morten On Wed, Jul 27, 2022 at 11:00 PM Martin Di Paola wrote: > > On Wed, Jul 27, 2022 at 08:32:31PM +0200, Morten W. Petersen wrote: > >You're thinking of the backlog arg

Re: Simple TCP proxy

2022-07-28 Thread Morten W. Petersen
to use emacs a lot, but then I came into a period where it was more practical to use nano, and I mostly use nano now, unless I need to for example search and replace or something like that. -Morten On Thu, Jul 28, 2022 at 8:31 AM Barry wrote: > > > > On 27 Jul 2022, at 17:16

Re: Simple TCP proxy

2022-07-28 Thread Morten W. Petersen
gards, Morten -- I am https://leavingnorway.info Videos at https://www.youtube.com/user/TheBlogologue Twittering at http://twitter.com/blogologue Blogging at http://blogologue.com Playing music at https://soundcloud.com/morten-w-petersen Also playing music and podcasting here: http://www.mixclou

Re: Simple TCP proxy

2022-07-27 Thread Morten W. Petersen
ly 25 were actively sending and receiving data at any given time. First come, first served. Regards, Morten On Wed, Jul 27, 2022 at 8:00 PM Chris Angelico wrote: > On Thu, 28 Jul 2022 at 02:15, Morten W. Petersen > wrote: > > > > Hi. > > > > I'd like to sha

Simple TCP proxy

2022-07-27 Thread Morten W. Petersen
s at https://www.youtube.com/user/TheBlogologue Twittering at http://twitter.com/blogologue Blogging at http://blogologue.com Playing music at https://soundcloud.com/morten-w-petersen Also playing music and podcasting here: http://www.mixcloud.com/morten-w-petersen/ On Google+ here https://plus.

Re: Simple message passing system and thread safe message queue

2022-07-18 Thread Morten W. Petersen
orten -- I am https://leavingnorway.info Videos at https://www.youtube.com/user/TheBlogologue Twittering at http://twitter.com/blogologue Blogging at http://blogologue.com Playing music at https://soundcloud.com/morten-w-petersen Also playing music and podcasting here: http://www.mixcloud.com/mo

Simple message passing system and thread safe message queue

2022-07-18 Thread Morten W. Petersen
Twittering at http://twitter.com/blogologue Blogging at http://blogologue.com Playing music at https://soundcloud.com/morten-w-petersen Also playing music and podcasting here: http://www.mixcloud.com/morten-w-petersen/ On Google+ here https://plus.google.com/107781930037068750156 On Instagram at

Re: Timezone for datetime.date objects

2022-03-06 Thread Morten W. Petersen
On Wed, Mar 2, 2022 at 6:20 PM Peter J. Holzer wrote: > 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 > > 202

Fwd: Timezone for datetime.date objects

2022-03-01 Thread Morten W. Petersen
Forwarding to the list.. -- Forwarded message - From: Morten W. Petersen Date: Tue, Mar 1, 2022 at 12:52 PM Subject: Re: Timezone for datetime.date objects To: Chris Angelico On Mon, Feb 28, 2022 at 11:57 PM Chris Angelico wrote: > On Tue, 1 Mar 2022 at 09:28, Morte

Re: Timezone for datetime.date objects

2022-02-28 Thread Morten W. Petersen
8:51, Cameron Simpson wrote: > > > > On 27Feb2022 11:16, Morten W. Petersen wrote: > > >I was initially using the date object to get the right timespan, but > > >then > > >found that using the right timezone with that was a bit of a pain. So I > > >went f

Timezone for datetime.date objects

2022-02-27 Thread Morten W. Petersen
le to specify a timezone? Regards, Morten -- I am https://leavingnorway.info Videos at https://www.youtube.com/user/TheBlogologue Twittering at http://twitter.com/blogologue Blogging at http://blogologue.com Playing music at https://soundcloud.com/morten-w-petersen Also playing music and podcas

Re: Most elegant way to do something N times

2019-12-23 Thread Morten W. Petersen
It depends on what's elegant, and beauty is in the eye of the beholder.. def recurse(n): print(”do be do be do”) if n>0: recurse(n-1) Regards, Morten søn. 22. des. 2019, 21:37 skrev Batuhan Taskaya : > I encounter with cases like doing a function 6 time with no argument, or > same argument

Re: What about idea of making a "Pythonic Lisp"...i.e. a Lisp that more closely resembles the syntax of Python?

2019-09-15 Thread Morten W. Petersen
goto main; Blogging at http://blogologue.com Tweeting at https://twitter.com/blogologue On Instagram https://instagram.com/morphexx søn. 15. sep. 2019, 03.07 skrev Christian Seberino : > Python is my goto main language. However, sometimes I'm tempted to > play with a Lisp like language just for

Re: Web framework for static pages

2019-08-13 Thread Morten W. Petersen
won't reply to this type of email. -Morten Blogging at http://blogologue.com Tweeting at https://twitter.com/blogologue On Instagram https://instagram.com/morphexx ons. 14. aug. 2019, 01.27 skrev DL Neil : > On 13/08/19 10:54 PM, Morten W. Petersen wrote: > > I was hoping to avo

Re: Web framework for static pages

2019-08-13 Thread Morten W. Petersen
Hi Joel. I don't disagree with what you're saying, but is there a documented way of making Django produce a neat set of static pages? It would be nice to use a web application framework to create pages, because it would after that be easy to add a little bit of logic if a customer wants it. A con

Re: Web framework for static pages

2019-08-13 Thread Morten W. Petersen
HMTL? Good you weren't in cat input after a newline. 😁 -Morten Blogging at http://blogologue.com Tweeting at https://twitter.com/blogologue On Instagram https://instagram.com/morphexx tir. 13. aug. 2019, 16.28 skrev Grant Edwards : > On 2019-08-13, Jon Ribbens via Python-list wrote: > > > If i

Re: Web framework for static pages

2019-08-13 Thread Morten W. Petersen
s it legacy websites? -Morten Blogging at http://blogologue.com Tweeting at https://twitter.com/blogologue On Instagram https://instagram.com/morphexx tir. 13. aug. 2019, 14.32 skrev Jon Ribbens via Python-list < python-list@python.org>: > On 2019-08-13, Morten W. Petersen wrote: >

Re: Web framework for static pages

2019-08-13 Thread Morten W. Petersen
Ok, will take a look at those. -Morten Blogging at http://blogologue.com Tweeting at https://twitter.com/blogologue On Instagram https://instagram.com/morphexx tir. 13. aug. 2019, 14.39 skrev Jan Erik Moström : > On 13 Aug 2019, at 12:54, Morten W. Petersen wrote: > > > I was hop

Re: Web framework for static pages

2019-08-13 Thread Morten W. Petersen
XML DTD for HTML5 by the way? -Morten Blogging at http://blogologue.com Tweeting at https://twitter.com/blogologue On Instagram https://instagram.com/morphexx tir. 13. aug. 2019, 11.39 skrev DL Neil : > On 13/08/19 10:01 AM, Morten W. Petersen wrote: > > On 12.08.2019 18:13, Brian Oney w

Re: Web framework for static pages

2019-08-13 Thread Morten W. Petersen
, 02.17 skrev Jon Ribbens via Python-list < python-list@python.org>: > On 2019-08-12, Morten W. Petersen wrote: > > What I guess I'm looking for, is something that will help create a > > static website, in a simple and efficient manner. Without being bloated. > > >

Re: Web framework for static pages

2019-08-13 Thread Morten W. Petersen
Right. That was a useful term, I've got some things to look at there. -Morten Blogging at http://blogologue.com Tweeting at https://twitter.com/blogologue On Instagram https://instagram.com/morphexx tir. 13. aug. 2019, 00.29 skrev Cameron Simpson : > On 13Aug2019 00:01, Morten W.

Re: Web framework for static pages

2019-08-12 Thread Morten W. Petersen
On 12.08.2019 18:13, Brian Oney wrote: On August 12, 2019 9:14:55 AM GMT+02:00, morphex wrote: Hi. What frameworks are there for generating static web pages in Python? I have used: https://github.com/Frozen-Flask/Frozen-Flask It's pretty simple. Develop with flask and then "freeze" it.

Focusing on the simple things, KISS, what to use for testing

2018-12-07 Thread Morten W. Petersen
7;t hurt with some forward thinking with what I choose from now on. Regards, Morten -- Videos at https://www.youtube.com/user/TheBlogologue Twittering at http://twitter.com/blogologue Blogging at http://blogologue.com Playing music at https://soundcloud.com/morten-w-petersen Also

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-12-02 Thread Morten W. Petersen
On Sun, Dec 2, 2018 at 1:20 PM Chris Angelico wrote: > On Sun, Dec 2, 2018 at 11:08 PM Morten W. Petersen > wrote: > > > > On Sun, Dec 2, 2018 at 12:49 PM Chris Angelico wrote: > >> To my knowledge, len(x) == len(list(x)) for any core data type that > >>

Re: Injecting methods into instance / class

2018-12-02 Thread Morten W. Petersen
ed from) class object. -Morten -- Videos at https://www.youtube.com/user/TheBlogologue Twittering at http://twitter.com/blogologue Blogging at http://blogologue.com Playing music at https://soundcloud.com/morten-w-petersen Also playing music and podcasting here: http://www.mixcl

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-12-02 Thread Morten W. Petersen
On Sun, Dec 2, 2018 at 12:49 PM Chris Angelico wrote: > On Sun, Dec 2, 2018 at 10:36 PM Morten W. Petersen > wrote: > > While we're on the subject, I did a test in my Python interpreter: > > > > Python 3.6.7 (default, Oct 22 2018, 11:32:17) > > [GCC 8.2.0] o

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-12-02 Thread Morten W. Petersen
On Sun, Dec 2, 2018 at 2:23 AM Chris Angelico wrote: > On Sun, Dec 2, 2018 at 11:55 AM Morten W. Petersen > wrote: > > > > On Sat, Dec 1, 2018 at 1:11 AM Chris Angelico wrote: > >> > >> On Sat, Dec 1, 2018 at 10:55 AM Morten W. Petersen > wrote: > &

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-12-01 Thread Morten W. Petersen
On Sat, Dec 1, 2018 at 1:11 AM Chris Angelico wrote: > On Sat, Dec 1, 2018 at 10:55 AM Morten W. Petersen > wrote: > > But this raises the question of how to write Python code, > > short and sweet, that could handle infinite iterators in > > such an unpack with multipl

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-11-30 Thread Morten W. Petersen
On Sat, Dec 1, 2018 at 12:25 AM Chris Angelico wrote: > On Sat, Dec 1, 2018 at 10:18 AM Morten W. Petersen > wrote: > > > > On Fri, Nov 30, 2018 at 7:25 PM Dan Sommers < > > 2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > > On 11/30/18 12:00 P

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-11-30 Thread Morten W. Petersen
On Fri, Nov 30, 2018 at 7:25 PM Dan Sommers < 2qdxy4rzwzuui...@potatochowder.com> wrote: > On 11/30/18 12:00 PM, Morten W. Petersen wrote: > > > I guess syntax could be added, so that > > > > a, b, @c = some sequence > > > > would initialize a and

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-11-30 Thread Morten W. Petersen
On Fri, Nov 30, 2018 at 6:21 PM Dan Sommers < 2qdxy4rzwzuui...@potatochowder.com> wrote: > On 11/30/18 10:57 AM, Morten W. Petersen wrote: > > On Fri, Nov 30, 2018 at 4:25 PM Dan Sommers > <2qdxy4rzwzuui...@potatochowder.com> wrote: > [...] > > But since you m

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-11-30 Thread Morten W. Petersen
On Fri, Nov 30, 2018 at 4:25 PM Dan Sommers < 2qdxy4rzwzuui...@potatochowder.com> wrote: > On 11/30/18 7:35 AM, Morten W. Petersen wrote: > > > ... but isn't it logical that the > > string is parsed and split, and then later the unpacking operation fails > > wi

Re: ValueError vs IndexError, unpacking arguments with string.split

2018-11-30 Thread Morten W. Petersen
On Fri, Nov 30, 2018 at 4:02 PM Peter Otten <__pete...@web.de> wrote: > Morten W. Petersen wrote: > > > I've been reading up on a bit of C++, Assembler etc. lately, so maybe my > > mind expected an IndexError because of that, but isn't it logical that > th

ValueError vs IndexError, unpacking arguments with string.split

2018-11-30 Thread Morten W. Petersen
unpacking operation fails with an IndexError? Regards, Morten -- Videos at https://www.youtube.com/user/TheBlogologue Twittering at http://twitter.com/blogologue Blogging at http://blogologue.com Playing music at https://soundcloud.com/morten-w-petersen Also playing music and podcasting

Behaviour of htmllib's HTML parser and formatter

2005-03-10 Thread Morten W. Petersen
Hi, I have an HTML page that displays some content, and a part of that content is HTML changed into regular text. The encoding of the page is UTF-8. Here's the code that makes the change (the HTML in self.contents is UTF-8 encoded): file = cStringIO.StringIO() parser = htmllib.HTMLParser(format