Re: REMOVE ME

2016-04-09 Thread Ben Finney
fan nie writes: > [no content] Thank you for sending a message to everyone on the mailing list, with the full correct information on how to check subscription settings and how to unsubscribe. As you are no doubt aware, since you left the message body entirely blank to draw attention to this, th

Re: REMOVE ME

2016-04-09 Thread Chris Angelico
On Sun, Apr 10, 2016 at 1:46 PM, fan nie wrote: > > -- > https://mail.python.org/mailman/listinfo/python-list Sure. I presume you mean something like this: class Thing: things = [] def __init__(self): self.things.append(self) def __del__(self): # Remove me when I'm de

REMOVE ME

2016-04-09 Thread fan nie
-- https://mail.python.org/mailman/listinfo/python-list

Re: Python,ping,csv

2016-04-09 Thread Jason Friedman
> for ping in range(1,254): > address = "10.24.59." + str(ping) > res = subprocess.call(['ping', '-c', '3', address]) > if res == 0: > print ("ping to", address, "OK") > elif res == 2: > print ("no response from", address) > else: > print ("ping to", addr

Re: QWERTY was not designed to intentionally slow typists down (was: Unicode normalisation [was Re: [beginner] What's wrong?])

2016-04-09 Thread pyotr filipivich
Dennis Lee Bieber on Sat, 09 Apr 2016 14:52:50 -0400 typed in comp.lang.python the following: >On Sat, 09 Apr 2016 11:44:48 -0400, Random832 >declaimed the following: > >>I don't understand where this idea that alternating hands makes you >>slows you down came from in the first place... I suspec

Re: Conditionals in Python cli with -m oneliner

2016-04-09 Thread Peter Otten
gvim wrote: > Given that this work in a Python 3 repl: > import re txt = "Some random text" if re.search(r"\b\w{4}\b", txt): txt 'Some random text' > > and this works on the command line, printing all lines in logs.txt: > > $ python3 -m oneliner -ne 'line' logs.txt > >

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Tim Golden
On 09/04/2016 22:23, Mark Lawrence via Python-list wrote: [... snip ...] Mark, you're ranting. Have a little dignity, please, and back off. TJG -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread Stephen Hansen
On Sat, Apr 9, 2016, at 12:25 PM, Mark Lawrence via Python-list wrote: > Again, where is the relevance to Python in this discussion, as we're on > the main Python mailing list? Please can the moderators take this stuff > out, it is getting beyond the pale. You need to come to grip with the fact

RE: [E] QWERTY was not designed to intentionally slow typists down (was: Unicode normalisation [was Re: [beginner] What's wrong?])

2016-04-09 Thread Coll-Barth, Michael via Python-list
-Original Message- From: Ben Finney >> This is an often-repeated myth, with citations back as far as the 1970s. >> It is false. >> The design is intended to reduce jamming the print heads together, but the >> goal of this is not to reduce speed, but to enable *fast* typing. >> It aims

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Ethan Furman
On 04/09/2016 12:36 PM, Mark Lawrence via Python-list wrote: Very amusing to see that some highly qualified 'moderators' have been so bloody rude on other Python mailing lists in the last days. Do as I say, not as I do? Nope -- you should take that as all of us are human and sometimes our te

Re: Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Joe
On Saturday, 9 April 2016 21:55:50 UTC+2, Mark Lawrence wrote: > On 09/04/2016 20:41, Joe wrote: > > > > Sorry, I was desperate > > I deleted the post > > > > You didn't. This will be showing in the archives in several places, e.g > https://mail.python.org/pipermail/python-list/2016-April/70716

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 21:22, alister wrote: On Sat, 09 Apr 2016 20:13:15 +0100, Mark Lawrence wrote: On 09/04/2016 01:43, Ben Finney wrote: Dennis Lee Bieber writes: Yet another completely irrelevant thread that has nothing to do with Python. As this is meant to be the main Python mailing list, w

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread alister
On Sat, 09 Apr 2016 20:13:15 +0100, Mark Lawrence wrote: > On 09/04/2016 01:43, Ben Finney wrote: >> Dennis Lee Bieber writes: >> >> > Yet another completely irrelevant thread that has nothing to do with > Python. As this is meant to be the main Python mailing list, why don't > the moderators pu

Re: Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 20:41, Joe wrote: Sorry, I was desperate I deleted the post You didn't. This will be showing in the archives in several places, e.g https://mail.python.org/pipermail/python-list/2016-April/707160.html -- My fellow Pythonistas, ask not what our language can do for you, ask wh

Re: Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Joe
On Saturday, 9 April 2016 21:24:02 UTC+2, Mark Lawrence wrote: > On 09/04/2016 18:13, Joe wrote: > > On Saturday, 9 April 2016 18:44:20 UTC+2, Ian wrote: > >> On Sat, Apr 9, 2016 at 8:18 AM, Joe wrote: > >>> How to find the number of robots needed to walk through the rectangular > >>> grid > >>

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 20:25, Tim Golden wrote: On 09/04/2016 20:13, Mark Lawrence via Python-list wrote: On 09/04/2016 01:43, Ben Finney wrote: Dennis Lee Bieber writes: Yet another completely irrelevant thread that has nothing to do with Python. As this is meant to be the main Python mailing list

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 17:08, Rustom Mody wrote: On Saturday, April 9, 2016 at 7:14:05 PM UTC+5:30, Ben Bacarisse wrote: The problem with that theory is that 'er/re' (this is e and r in either order) is the 3rd most common pair in English but have been placed together. ou and et (in either order) are th

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Tim Golden
On 09/04/2016 20:13, Mark Lawrence via Python-list wrote: On 09/04/2016 01:43, Ben Finney wrote: Dennis Lee Bieber writes: Yet another completely irrelevant thread that has nothing to do with Python. As this is meant to be the main Python mailing list, why don't the moderators put a stop to

Re: Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 18:13, Joe wrote: On Saturday, 9 April 2016 18:44:20 UTC+2, Ian wrote: On Sat, Apr 9, 2016 at 8:18 AM, Joe wrote: How to find the number of robots needed to walk through the rectangular grid The movement of a robot in the field is divided into successive steps In one step a rob

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 01:43, Ben Finney wrote: Dennis Lee Bieber writes: Yet another completely irrelevant thread that has nothing to do with Python. As this is meant to be the main Python mailing list, why don't the moderators put a stop to such tripe? -- My fellow Pythonistas, ask not what our

Conditionals in Python cli with -m oneliner

2016-04-09 Thread gvim
Given that this work in a Python 3 repl: import re txt = "Some random text" if re.search(r"\b\w{4}\b", txt): txt 'Some random text' and this works on the command line, printing all lines in logs.txt: $ python3 -m oneliner -ne 'line' logs.txt . why does this fail: $ python3 -m oneli

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread Ben Bacarisse
Rustom Mody writes: > On Saturday, April 9, 2016 at 7:14:05 PM UTC+5:30, Ben Bacarisse wrote: >> The problem with that theory is that 'er/re' (this is e and r in either >> order) is the 3rd most common pair in English but have been placed >> together. ou and et (in either order) are the 15th and

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Paul Rubin
Ben Finney writes: > The ‘cmp’ implementation must decide *at least* between three > conditions... The implementation of ‘__lt__’ and the implementation > of ‘__eq__’ each only need to decide two conditions (true, false). > If you're saying the latter implementation is somehow *more* expensive >

Re: Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Joe
On Saturday, 9 April 2016 18:44:20 UTC+2, Ian wrote: > On Sat, Apr 9, 2016 at 8:18 AM, Joe wrote: > > How to find the number of robots needed to walk through the rectangular grid > > The movement of a robot in the field is divided into successive steps > > > > In one step a robot can move either

Re: Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Ian Kelly
On Sat, Apr 9, 2016 at 8:18 AM, Joe wrote: > How to find the number of robots needed to walk through the rectangular grid > The movement of a robot in the field is divided into successive steps > > In one step a robot can move either horizontally or vertically (in one row or > in one column of ce

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Marko Rauhamaa
Antoon Pardon : > And when I need some personal object as a key, I can avoid the > duplication by using some kind of cmp cache when I implement __lt__ > and family. Yes, that's what you can do in rare, extreme cases where key comparison takes a long time. For caching, you will simply need to requ

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread Rustom Mody
On Saturday, April 9, 2016 at 7:14:05 PM UTC+5:30, Ben Bacarisse wrote: > The problem with that theory is that 'er/re' (this is e and r in either > order) is the 3rd most common pair in English but have been placed > together. ou and et (in either order) are the 15th and 22nd most common > and the

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Antoon Pardon
Op 09-04-16 om 17:31 schreef Chris Angelico: > On Sun, Apr 10, 2016 at 1:24 AM, Antoon Pardon > wrote: >> >> So? I need a structure that can easily give me an answer to the >> following: Given key1 and key2 what are the the keys between them >> with their corresponding values. As long as a dict ca

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Random832
On Sat, Apr 9, 2016, at 07:49, Ben Finney wrote: > I find that a dubious claim. > > The ‘cmp’ implementation must decide *at least* between three > conditions: less-than, equal-to, greater-than. That is *at least* two > inflection points. Yes, but in a sequence it can decide that at each element,

Re: QWERTY was not designed to intentionally slow typists down (was: Unicode normalisation [was Re: [beginner] What's wrong?])

2016-04-09 Thread Random832
On Fri, Apr 8, 2016, at 23:28, Steven D'Aprano wrote: > This is the power of the "slowing typists down is a myth" meme: same > Wikipedia contributor takes an article which *clearly and obviously* > repeats the conventional narrative that QWERTY was designed to > decrease the number of key presses p

Re: QWERTY was not designed to intentionally slow typists down (was: Unicode normalisation [was Re: [beginner] What's wrong?])

2016-04-09 Thread Random832
On Fri, Apr 8, 2016, at 23:28, Steven D'Aprano wrote: > And how did it enable fast typing? By *slowing down the typist*, and thus > having fewer jams. Er, no? The point is that type bars that are closer together collide more easily *at the same actual typing speed* than ones that are further apart

Re: (Python 3.5) Asyncio and an attempt to run loop.run_until_complete() from within a running loop

2016-04-09 Thread Ian Kelly
On Sat, Apr 9, 2016 at 9:14 AM, Ian Kelly wrote: > On Fri, Apr 8, 2016 at 5:54 PM, Alexander Myodov wrote: > This does mean that the pattern for calling aio_map from outside the > event loop is different from calling it inside the event loop. Your > main_loop coroutine becomes (note the addition

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Chris Angelico
On Sun, Apr 10, 2016 at 1:24 AM, Antoon Pardon wrote: > Op 09-04-16 om 16:41 schreef Chris Angelico: > >> >> In this case, you're likely to end up with large branches of your tree >> that have the same prefix. (And if you don't, your iterations are all >> going to end early anyway, so the comparis

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Antoon Pardon
Op 09-04-16 om 16:41 schreef Chris Angelico: > > In this case, you're likely to end up with large branches of your tree > that have the same prefix. (And if you don't, your iterations are all > going to end early anyway, so the comparison is cheap.) A data > structure that takes this into account

Re: Repair??

2016-04-09 Thread Random832
- Original message - From: Amaya McLean To: Random832 Subject: Re: Repair?? Date: Sat, 9 Apr 2016 10:41:52 -0400 How, specifically, are you installing Python? There are many ways, and > we can't guess which you use. > I'm trying to install Python on my laptop, from python.org > Which par

Re: (Python 3.5) Asyncio and an attempt to run loop.run_until_complete() from within a running loop

2016-04-09 Thread Ian Kelly
On Fri, Apr 8, 2016 at 5:54 PM, Alexander Myodov wrote: > Hello. > > TLDR: how can I use something like loop.run_until_complete(coro), to execute > a coroutine synchronously, while the loop is already running? > > More on this: > > I was trying to create an aio_map(coro, iterable) function (which

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Marko Rauhamaa
Antoon Pardon : > Now this probably is not a problem most of the times, but when you > work with tree's this kind of comparison to make a three way decision > happens often and the lower you descend in the tree, the close your > argument will be with the keys of the nodes you visit, making it more

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Chris Angelico
On Sun, Apr 10, 2016 at 12:25 AM, Antoon Pardon wrote: > Let me give you an artifical example to show what can happen. The keys are all > iterables of equal lengths with integers as elements. > > Then this could be the cmp function: > > def cmp(ob1, ob2): > itr1 = iter(ob1) > itr2 = iter(o

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread Ben Bacarisse
Ben Bacarisse writes: > alister writes: > >> >> the design of qwerty was not to "Slow" the typist bu to ensure that the >> hammers for letters commonly used together are spaced widely apart, >> reducing the portion of trier travel arc were the could jam. >> I and E are actually such a pair w

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Antoon Pardon
Op 09-04-16 om 13:49 schreef Ben Finney: > Antoon Pardon writes: > >> You don't seem to understand. I only do two comparisons and no the >> equality is not necesarrily cheaper. >> >> I am talking about the difference between the following two: >> >> if arg.key < node.key: # possible expensi

Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Joe
How to find the number of robots needed to walk through the rectangular grid The movement of a robot in the field is divided into successive steps In one step a robot can move either horizontally or vertically (in one row or in one column of cells) by some number of cells A robot can move in one

Re: past exam paper help!

2016-04-09 Thread Ian Kelly
On Sat, Apr 9, 2016 at 7:49 AM, Joseph Caulfield wrote: > On Saturday, April 9, 2016 at 2:48:16 PM UTC+1, Joseph Caulfield wrote: >> how would I model a mug a cylindrical vessel with an open top in python? >> thansk :) > > *as a cylindrical vessel. class Vessel: def __init__(self, shape, o

past exam paper help!

2016-04-09 Thread Joseph Caulfield
how would I model a mug a cylindrical vessel with an open top in python? thansk :) -- https://mail.python.org/mailman/listinfo/python-list

Re: past exam paper help!

2016-04-09 Thread Joseph Caulfield
On Saturday, April 9, 2016 at 2:48:16 PM UTC+1, Joseph Caulfield wrote: > how would I model a mug a cylindrical vessel with an open top in python? > thansk :) *as a cylindrical vessel. -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread Ben Bacarisse
alister writes: > > the design of qwerty was not to "Slow" the typist bu to ensure that the > hammers for letters commonly used together are spaced widely apart, > reducing the portion of trier travel arc were the could jam. > I and E are actually such a pair which is why they are at opposite

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Ben Finney
Antoon Pardon writes: > You don't seem to understand. I only do two comparisons and no the > equality is not necesarrily cheaper. > > I am talking about the difference between the following two: > > if arg.key < node.key: # possible expensive computation > go_left() > elif arg.k

conda: Fetching package metadata: SSL verification error: EOF occurred in violation of protocol (_ssl.c:645)

2016-04-09 Thread Hongyi Zhao
Hi all, I use the latest conda, ie, Anaconda3-4.0.0-Linux-x86_64 to install some packages, but always meet the following error: $ conda install conda-build Using Anaconda Cloud api site https://api.anaconda.org Fetching package metadata: SSL verification error: EOF occurred in violation of pro

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Antoon Pardon
Op 08-04-16 om 16:25 schreef Chris Angelico: > On Sat, Apr 9, 2016 at 12:20 AM, Antoon Pardon > wrote: >>> You only need ONE comparison, and the other is presumed to be its >>> opposite. When, in the Python 3 version, would you need to compare >>> twice? >> >> About 50% of the time. When I travers

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread alister
On Fri, 08 Apr 2016 20:20:02 -0400, Dennis Lee Bieber wrote: > On Fri, 8 Apr 2016 11:04:53 -0700 (PDT), Rustom Mody > declaimed the following: > >>Its reasonably likely that all our keyboards start QWERT... >> Doesn't make it a sane design. >> > It was a sane design -- for early mechanical