Re: Suggestion: make sequence and map interfaces more similar

2016-03-30 Thread Mark Lawrence via Python-list
On 30/03/2016 21:00, Marco Sulla via Python-list wrote: Let me also add that even if it seems that my idea will not break any official contracts, I can create a new ABC class and let maps and sequence types inherit from it. IMHO it's absolutely not needed, but at least the discussion will be no

Re: Suggestion: make sequence and map interfaces more similar

2016-03-30 Thread Mark Lawrence via Python-list
On 30/03/2016 20:35, Marco Sulla via Python-list wrote: On 30 March 2016 at 02:55, Terry Reedy wrote: To me [seq.items() and seq.keys()] are useless and confusing duplications since enumerate()(seq) and range(len(seq)) are quite different from dict.items and dict.keys.

Re: Adding borders to ttk radiobuttons

2016-03-30 Thread Mark Lawrence via Python-list
On 30/03/2016 17:35, Terry Reedy wrote: .theme_names() only displays the themes for the OS. I believe that there is a way to access themes for other OSes (unix, mac) but don't remember. Possibly http://bugs.python.org/issue17397 which refers to

Re: Python Array

2016-03-31 Thread Mark Lawrence via Python-list
On 31/03/2016 06:34, tdspe...@gmail.com wrote: I am creating the following aData = [] This is a Python list, not an array as the subject gives. # get my data from database for row in rows:

Re: tkinter Entry validation modes

2016-04-05 Thread Mark Lawrence via Python-list
On 02/04/2016 19:45, Terry Reedy wrote: On 4/2/2016 11:11 AM, Mark Lawrence via Python-list wrote: A typical call to create an Entry field would be:- e = Entry(master, validate='all', ...) Once this call has been made is it possible to change the validation mode at runtime? AFAIK, every

Re: Label behavior's difference between tkinter and ttk

2016-04-05 Thread Mark Lawrence via Python-list
On 05/04/2016 07:57, ast wrote: Hello I currently migrate a GUI from tkinter to ttk and I found a problem Here is a piece of code, with comments which explain what is wrong. import tkinter as tk import tkinter.ttk as ttk root = tk.Tk() BITMAP0 = """ #define zero_width 24 #define zero_height

Re: how to convert code that uses cmp to python3

2016-04-07 Thread Mark Lawrence via Python-list
On 07/04/2016 13:05, Antoon Pardon wrote: I am looking at my avltree module for converting it to python3. One of the things that trouble me here is how python3 no longer has cmp and how things have to be of "compatible" type in order to be comparable. So in python2 it wasn't a problem to have

Re: how to convert code that uses cmp to python3

2016-04-07 Thread Mark Lawrence via Python-list
On 07/04/2016 21:56, Antoon Pardon wrote: Op 07-04-16 om 14:22 schreef Chris Angelico: ... There's no __cmp__ method, but you could easily craft your own compare() function: def compare(x, y): """Return a number < 0 if x < y, or > 0 if x > y""" if x == y: return 0 return -1 if

Re: Promoting Python

2016-04-06 Thread Mark Lawrence via Python-list
On 06/04/2016 18:55, Ned Batchelder wrote: It took us a while to understand where Bart was coming from, but now we understand, and we don't have to go around in circles. No it didn't, it was quite clear from the beginning that he knew squat, and since then he's admitted that he knows squat.

Re: python script for .dat file

2016-04-05 Thread Mark Lawrence via Python-list
On 05/04/2016 16:23, Muhammad Ali wrote: Hello, Could any body tell me a general python script to generate .dat file after the extraction of data from more than 2 files, say file A and file B? Or could any body tell me the python commands to generate .dat file after the extraction of data

Re: Install request

2016-04-05 Thread Mark Lawrence via Python-list
On 05/04/2016 16:56, Igor Korot wrote: Hi, python community, Recently there was a huge number of e-mail stating that the python installer does not work. When asked about it, people reveal that they wee using Windows and they were getting errors about missing DLL. I know for a fact that in

Re: python script for .dat file

2016-04-05 Thread Mark Lawrence via Python-list
On 05/04/2016 21:35, Michael Selik wrote: What code have you written so far? Would you please not top post on this list, it drives me nuts!!! -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Mark Lawrence via Python-list
On 05/04/2016 19:49, Sven R. Kunze wrote: It appears to me as if you like messy code then. ;) The messy code is with the person who needlessly splits a single module of a few thousand lines into several modules just for the sake of it. If you want to play yo-yo, leaping from source file to

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

Re: [beginner] What's wrong?

2016-04-08 Thread Mark Lawrence via Python-list
On 08/04/2016 23:59, sohcahto...@gmail.com wrote: On Friday, April 1, 2016 at 3:57:40 PM UTC-7, Mark Lawrence wrote: On 01/04/2016 23:44, sohcahto...@gmail.com wrote: On Friday, April 1, 2016 at 3:10:51 PM UTC-7, Michael Okuntsov wrote: Nevermind. for j in range(1,8) should be for j in

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

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

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

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 <wlfr...@ix.netcom.com> writes: Yet another completely irrelevant thread that has nothing to do with Python. As this is

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

Re: Checking function's parameters (type, value) or not ?

2016-04-06 Thread Mark Lawrence via Python-list
On 06/04/2016 14:07, ast wrote: Hello I would like to know if it is advised or not to test a function's parameters before running it, e.g for functions stored on a public library ? Example: def to_base(nber, base=16, use_af=True, sep=''): assert isinstance(nber, int) and nber >= 0

Re: Promoting Python

2016-04-06 Thread Mark Lawrence via Python-list
On 06/04/2016 12:06, BartC wrote: On 05/04/2016 06:48, Gordon( Hotmail ) wrote: I am struggling to understand the basic principles of Python having spent many years as a pure Amateur tinkering with a variety of BASIC Last time I looked, there seemed to be around 250 dialects of Basic, and

Re: Promoting Python

2016-04-06 Thread Mark Lawrence via Python-list
On 06/04/2016 15:34, Ned Batchelder wrote: On Wednesday, April 6, 2016 at 10:25:13 AM UTC-4, Mark Lawrence wrote: On 06/04/2016 14:54, BartC wrote: On 06/04/2016 12:46, Marko Rauhamaa wrote: BartC : It'll cope with ordinary coding as well, although such programs seem to be

Re: Promoting Python

2016-04-06 Thread Mark Lawrence via Python-list
On 06/04/2016 14:54, BartC wrote: On 06/04/2016 12:46, Marko Rauhamaa wrote: BartC : It'll cope with ordinary coding as well, although such programs seem to be frowned upon here; they are not 'Pythonic'. I wonder what is left of Python after your list of exclusions.

Re: deque is not a subclass of Sequence.

2016-04-07 Thread Mark Lawrence via Python-list
On 07/04/2016 10:25, Antoon Pardon wrote: the index() method seems to be added in 3.5, so is deque a subclass of Sequence in 3.5? Yes, this http://bugs.python.org/issue23704 refers. Use the builtin https://docs.python.org/3/library/functions.html#issubclass to try it. >>>

Re: [beginner] What's wrong?

2016-04-02 Thread Mark Lawrence via Python-list
On 03/04/2016 01:48, Steven D'Aprano wrote: On Sun, 3 Apr 2016 07:42 am, Michael Selik wrote: Gaming also helps your reaction time. Normally 0.3 ms, but 0.1 ms for top gamers. And fighter pilots. Does gaming help reaction time, or do only people with fast reaction times become top gamers?

Re: [Beginner] - Hanging in the code, can't figure out what's wrong

2016-04-02 Thread Mark Lawrence via Python-list
On 03/04/2016 01:12, BartC wrote: On 02/04/2016 23:31, Loop.IO wrote: Oh i see, so the code prompts for a name.. so i'm more lost than i thought, what do I need to change to make it just create the file with the chosen name Launch2.bat without the prompt? If you don't want the user to enter

Re: [Beginner] - Hanging in the code, can't figure out what's wrong

2016-04-02 Thread Mark Lawrence via Python-list
On 02/04/2016 23:37, Michael Selik wrote: I might be overlooking something, but raw_input (Python 2) and input (Python 3) won't return the input from sys.stdin until you type ENTER. Or did I misunderstand the question? On Sat, Apr 2, 2016 at 6:30 PM BartC wrote: On

Re: [Beginner] - Hanging in the code, can't figure out what's wrong

2016-04-02 Thread Mark Lawrence via Python-list
On 02/04/2016 23:23, Loop.IO wrote: On Saturday, April 2, 2016 at 11:09:13 PM UTC+1, BartC wrote: On 02/04/2016 22:59, Loop.IO wrote: Hey So I built a keylogger using python as a test, got the code from the tutorial online, I want to improve on it to make it more automated, but the issue I'm

Re: [beginner] What's wrong?

2016-04-02 Thread Mark Lawrence via Python-list
On 02/04/2016 17:31, Dennis Lee Bieber wrote: On Sat, 2 Apr 2016 19:15:36 +1100, Chris Angelico declaimed the following: On Sat, Apr 2, 2016 at 3:27 PM, Random832 wrote: On Fri, Apr 1, 2016, at 19:29, Michael Selik wrote: Humans have always had

Re: [beginner] What's wrong?

2016-04-02 Thread Mark Lawrence via Python-list
On 03/04/2016 00:49, Steven D'Aprano wrote: On Sun, 3 Apr 2016 03:12 am, Thomas 'PointedEars' Lahn wrote: Marko Rauhamaa wrote: Steven D'Aprano : So you're saying that learning to be a fluent speaker of English is a pre-requisite of being a programmer? No more than

Re: Strange range

2016-04-04 Thread Mark Lawrence via Python-list
On 03/04/2016 17:28, Ethan Furman wrote: On 04/02/2016 11:58 PM, Marko Rauhamaa wrote: Stephen Hansen : I'm pretty sure that 99+% of the non-stdlib code out there is also completely inaccessible (or at least inconveniently accessible) to Stephen as well.

Re: [beginner] What's wrong?

2016-04-04 Thread Mark Lawrence via Python-list
On 02/04/2016 23:49, Michael Torrie wrote: Mark, your messages are showing up to the list as being from "python," at least on my email. Any reason for this? Assuming that you're referring to me, frankly I haven't a clue. I read this list with Thunderbird on Windows, I hit "reply" to

Adding borders to ttk radiobuttons

2016-03-30 Thread Mark Lawrence via Python-list
I believe something like this should suffice to display borders around the radiobuttons. import tkinter as tk import tkinter.ttk as ttk root = tk.Tk() style = ttk.Style() style.configure('BW.TRadiobutton', borderwidth=5) buttonVar = tk.IntVar() rb1 = ttk.Radiobutton(text='Hello mum',

Re: Instalação

2016-03-30 Thread Mark Lawrence via Python-list
On 30/03/2016 14:13, Alan Evangelista wrote: Não consigo instalar o python no meu Windows,gostaria de alguma ajuda ou esclarecimento Natalia, you should use English in this mailing list. - download latest Python. Python has 2 different versions under development: Python 2 and Python 3. As

Re: Adding borders to ttk radiobuttons

2016-03-30 Thread Mark Lawrence via Python-list
On 30/03/2016 15:45, ast wrote: "Mark Lawrence" a écrit dans le message de news:mailman.204.1459343690.28225.python-l...@python.org... I believe something like this should suffice to display borders around the radiobuttons. import tkinter as tk import tkinter.ttk as

Re: Adding borders to ttk radiobuttons

2016-03-30 Thread Mark Lawrence via Python-list
On 30/03/2016 15:55, ast wrote: "ast" a écrit dans le message de news:56fbe699$0$4548$426a7...@news.free.fr... "Mark Lawrence" a écrit dans le message de news:mailman.204.1459343690.28225.python-l...@python.org... I believe something like this

Re: Suggestion: make sequence and map interfaces more similar

2016-03-31 Thread Mark Lawrence via Python-list
On 31/03/2016 14:08, Antoon Pardon wrote: Op 31-03-16 om 13:57 schreef Chris Angelico: Okay. I'll put a slightly different position: Prove that your proposal is worth discussing by actually giving us an example that we can discuss. So far, this thread has had nothing but toy examples (and

Re: Suggestion: make sequence and map interfaces more similar

2016-03-31 Thread Mark Lawrence via Python-list
On 31/03/2016 14:27, Random832 wrote: On Thu, Mar 31, 2016, at 09:17, Mark Lawrence via Python-list wrote: On 31/03/2016 14:08, Antoon Pardon wrote: Op 31-03-16 om 13:57 schreef Chris Angelico: Okay. I'll put a slightly different position: Prove that your proposal is worth discussing

Re: Suggestion: make sequence and map interfaces more similar

2016-04-01 Thread Mark Lawrence via Python-list
On 01/04/2016 08:59, Antoon Pardon wrote: Op 31-03-16 om 16:12 schreef Mark Lawrence via Python-list: On 31/03/2016 14:27, Random832 wrote: So can we discuss how a unified method to get a set of all valid subscripts (and/or subscript-value pairs) on an object would be a useful thing to have

Re: Drowning in a teacup?

2016-04-02 Thread Mark Lawrence via Python-list
On 02/04/2016 06:51, Michael Selik wrote: On Sat, Apr 2, 2016, 1:46 AM Vito De Tullio wrote: Fillmore wrote: I need to scan a list of strings. If one of the elements matches the beginning of a search keyword, that element needs to snap to the front of the list. I

Re: Drowning in a teacup?

2016-04-01 Thread Mark Lawrence via Python-list
On 01/04/2016 21:27, Fillmore wrote: notorious pass by reference vs pass by value biting me in the backside here. Proceeding in order. It is pass by object. By definition your following analysis is wrong. To my knowledge this has been discussed at least twice a year for the past 15 years.

Re: Strange range

2016-04-01 Thread Mark Lawrence via Python-list
On 01/04/2016 21:44, Marko Rauhamaa wrote: Rob Gaddi : Marko Rauhamaa wrote: There's a bit of a cognitive dissonance between iterables and iterators. On the one hand, they behave identically in many contexts. On the other hand, the distinction is crucial in

Re: [beginner] What's wrong?

2016-04-01 Thread Mark Lawrence via Python-list
On 01/04/2016 23:10, Michael Okuntsov wrote: Nevermind. for j in range(1,8) should be for j in range(8). Thank you for your correction, we in Python land greatly appreciate such things :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our

Re: [beginner] What's wrong?

2016-04-01 Thread Mark Lawrence via Python-list
On 01/04/2016 23:44, sohcahto...@gmail.com wrote: On Friday, April 1, 2016 at 3:10:51 PM UTC-7, Michael Okuntsov wrote: Nevermind. for j in range(1,8) should be for j in range(8). I can't tell you how many times I've gotten bit in the ass with that off-by-one mistake whenever I use a range

tkinter Entry validation modes

2016-04-02 Thread Mark Lawrence via Python-list
A typical call to create an Entry field would be:- e = Entry(master, validate='all', ...) Once this call has been made is it possible to change the validation mode at runtime? Background, I'm knocking up an app so I can play with the various modes so that I can see how they work, as I'm just

Re: Best Practices for Internal Package Structure

2016-04-04 Thread Mark Lawrence via Python-list
On 04/04/2016 19:45, Michael Selik wrote: On Mon, Apr 4, 2016 at 6:04 PM Sven R. Kunze wrote: Hi Josh, good question. On 04.04.2016 18:47, Josh B. wrote: My package, available at https://github.com/jab/bidict, is currently laid out like this: bidict/ ├── __init__.py ├──

Re: IDLE's subprocess didn't make connection. Either IDLE can't start or personal firewall software is blocking connection.

2016-04-04 Thread Mark Lawrence via Python-list
On 04/04/2016 21:19, Steven Gao wrote: I’m getting “IDLE's subprocess didn't make connection. Either IDLE can't start or personal firewall software is blocking connection.”. Any ideas? Sent from Mail for Windows 10 Asked and answered repeatedly, please search the archives for the answer.

Re: Suggestion: make sequence and map interfaces more similar

2016-03-30 Thread Mark Lawrence via Python-list
On 29/03/2016 23:29, Marco Sulla via Python-list wrote: Let me add that an items() and keys() for sequences will be also useful for day-by-day programming, since they will be a shortcut for enumerate(seq) and range(len(seq)) I cannot remember the last time I needed range(len(seq)) so I don't

Re: Suggestion: make sequence and map interfaces more similar

2016-03-31 Thread Mark Lawrence via Python-list
On 31/03/2016 12:58, Marco Sulla via Python-list wrote: On 31 March 2016 at 04:40, Steven D'Aprano wrote: Enough of the hypothetical arguments about what one could do or might do. Let's see a concrete example of actual real world code used in production, not a mickey-mouse

Re: Suggestion: make sequence and map interfaces more similar

2016-03-31 Thread Mark Lawrence via Python-list
On 31/03/2016 13:49, Marco Sulla via Python-list wrote: On 31 March 2016 at 14:30, Mark Lawrence via Python-list <python-list@python.org> wrote: Note that dict also supports __getitem__() and __len__(), but is considered a mapping rather than a sequence because the lookups use arb

Network protocols, sans I/O,(Hopefully) the future of network protocols in Python

2016-08-08 Thread Mark Lawrence via Python-list
This may be of interest to some of you http://www.snarky.ca/network-protocols-sans-i-o -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-14 Thread Mark Lawrence via Python-list
On 14/09/2017 05:37, Terry Reedy wrote: On 9/13/2017 2:44 AM, Paul Rubin wrote: Are there actually Py3 codebases? Let's think a bit.  There is the Python half of the Python3 codebase, perhaps 400K.  But we can discount that. Then there are all the Py compatible modules on PyPI, which is

Re: [Tutor] beginning to code

2017-09-23 Thread Mark Lawrence via Python-list
On 23/09/2017 04:06, Bill wrote: Mark Lawrence wrote: On 22/09/2017 08:01, Bill wrote: Steve D'Aprano wrote: On Fri, 22 Sep 2017 02:57 pm, Bill wrote: I find Python to be more more like Java, with regard to "passing objects by reference". Which is not a surprise, since both Python and Java

Re: Easy way to get a list of tuples.

2017-09-21 Thread Mark Lawrence via Python-list
On 21/09/2017 11:18, Sayth Renshaw wrote: Hi I have been toying with json and I particular area where I cannot get the desired result a list of tuples as my return. The json from the API is way to long but I don't think it will matter. .. hitting url data = r.json() for item in

Re: [Tutor] beginning to code

2017-09-22 Thread Mark Lawrence via Python-list
On 22/09/2017 08:01, Bill wrote: Steve D'Aprano wrote: On Fri, 22 Sep 2017 02:57 pm, Bill wrote: I find Python to be more more like Java, with regard to "passing objects by reference". Which is not a surprise, since both Python and Java use the same value passing style: pass by object

Re: [Tutor] beginning to code

2017-09-22 Thread Mark Lawrence via Python-list
On 22/09/2017 10:53, Bill wrote: I just wanted to mention that my comment was made in the context that Python is implemented by an interpreter written in C.   I realize that this may not always be the case.  However, I haven't heard anyone mention a Python interpreter written in Python yet.

Re: Python 2 -> 3, urllib.urlOpen

2017-10-14 Thread Mark Lawrence via Python-list
On 13/10/17 23:27, Irv Kalb wrote: One of the colleges where I teach has just moved from Python 2 to Python 3. I am in the process of converting my beginning Python class from Python 2 to Python 3. Everything has gone smoothly, until I just tried to convert some code that imports and uses

Re: Printing a Chunk Of Words

2017-09-28 Thread Mark Lawrence via Python-list
On 26/09/2017 01:15, Cai Gengyang wrote: """ Boolean Operators True and True is True True and False is False False and True is False False and False is False True or True is True True or False is True False or True is True False or False is False Not True is