Re: What's the meaning the "backlog" in the socket.listen(backlog) is?

2021-02-17 Thread Karen Shaeffer via Python-list
> On Feb 16, 2021, at 8:10 PM, Jason Friedman wrote: > >> >> I set listen(2) and expect to see "error" when more clients than "the >> maximum number of queued connections" trying to connect the server. But, no >> error!! Even 4 clients can run normally without problem. >> >> Am I misunderstan

Re: What's the meaning the "backlog" in the socket.listen(backlog) is?

2021-02-17 Thread Karen Shaeffer via Python-list
> On Feb 17, 2021, at 12:25 AM, Karen Shaeffer via Python-list > wrote: > > > >> On Feb 16, 2021, at 8:10 PM, Jason Friedman wrote: >> >>> >>> I set listen(2) and expect to see "error" when more clients than "the >>> ma

Re: New Python implementation

2021-02-17 Thread Alan Gauld via Python-list
On 16/02/2021 22:23, boB Stepp wrote: >> And that's just one example, the language is now full of meta goodness >> that makes it incomprehensible to beginners. > > Hmm. I'm not sure I can agree, Alan. My son took to Python 3 like a duck to > water. That's interesting. I knew you were teachi

Re: New Python implementation

2021-02-17 Thread Alan Gauld via Python-list
On 16/02/2021 21:22, Tarjei Bærland via Python-list wrote: > To me, it depends on what you want out of including programming in > mathematics education. That's a really important subclass distinction. If programming is seen as an adjunct to math then the aims can be simplified conside

RE: New Python implementation

2021-02-18 Thread Avi Gross via Python-list
2:45 AM To: [email protected] Subject: Re: New Python implementation On Tue, 16 Feb 2021 11:03:33 +, Alan Gauld via Python-list declaimed the following: >On 16/02/2021 07:35, Christian Gollwitzer wrote: >> Am 16.02.21 um 06:36 schrieb dn: >>> Pascal's value as a teach

Fw: Scipy installation

2021-02-18 Thread Mustafa Althabit via Python-list
Hi,I am trying to install Scipy but it failed, I have python 3.9. I need your assistance with that.  Thank you Mustafa Althabit8133825988 -- https://mail.python.org/mailman/listinfo/python-list

Re: New Python implementation

2021-02-19 Thread Alan Gauld via Python-list
On 19/02/2021 03:51, Dennis Lee Bieber wrote: > They chose Pascal as being more modern, and something taught in schools > (yeah, like TurboPascal is going to be a good introduction to writing > software for real-time ground control of satellites). Funnily enough it was. Or at least for rea

Re: Startup failure

2021-02-19 Thread Alan Gauld via Python-list
On 19/02/2021 06:27, Smit Patel wrote: > I recently downloaded python from your website and when I started using it, > it worked correctly but when I installed the random2 module it showed > startup failure and won't work again. > So, I uninstalled it and downloaded it again but it is showing the s

RE: New Python implementation

2021-02-19 Thread Avi Gross via Python-list
lly if you came to python from another language that method was borrowed from or vice versa. Being a rich language has pro's and cons. LISP only had cons. -Original Message- From: Python-list On Behalf Of Alan Gauld via Python-list Sent: Friday, February 19, 2021 6:23 AM To: python-

RE: New Python implementation

2021-02-19 Thread Avi Gross via Python-list
Benjamin, I wonder if you understood my intended meaning not about the plusses and minuses of using a language like LISP but that it is fundamentally build on using the CONS concept to make lists in a poetic way but has no PROSE. Not only does every language have what I meant by the usual meani

Re: New Python implementation

2021-02-19 Thread Alan Gauld via Python-list
On 19/02/2021 18:14, Michael F. Stemper wrote: >> and cons. LISP only had cons. :-) LOL -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos -- http

RE: Is there a way to subtract 3 from every digit of a number?

2021-02-20 Thread Avi Gross via Python-list
Wouldn't it be nice, Grant, if Homework was assigned with statements like: "Using only the features of the language covered up to chapter 3, meaning individual variables and lists of them and simple loops and only using the arithmetic built-in variable of +, -, % ... Solve this problem " But

RE: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread Avi Gross via Python-list
Mike, You moved the goalpost. Some of us here have been speculating you were asking what we call a homework question here. The problem seemed to be the kind asked for that can be done using fairly simple commands in python combined together. Of course, some of the answers posted used ideas usua

RE: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread Avi Gross via Python-list
, Feb 22, 2021 at 1:39 AM Avi Gross via Python-list wrote: > But you just moved the goalpost by talking about using a data.frame as > that (and I assume numpy and pandas) are not very basic Python. Given that the original post mentioned a pd.Series, I don't know how far the goalpos

RE: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread Avi Gross via Python-list
ilable in Python. I hope that clears up some confusion. Cheer! On Sun, Feb 21, 2021 at 9:44 AM Chris Angelico wrote: > On Mon, Feb 22, 2021 at 1:39 AM Avi Gross via Python-list > wrote: > > But you just moved the goalpost by talking about using a data.frame > > as > that &g

Re: name for a mutually inclusive relationship

2021-02-24 Thread Alan Gauld via Python-list
On 24/02/2021 16:12, Ethan Furman wrote: > I'm looking for a name for a group of options that, when one is specified, > all of them must be specified. > > For contrast, > > - radio buttons: a group of options where only one can be specified (mutually > exclusive) > - check boxes: a group of o

RE: name for a mutually inclusive relationship

2021-02-24 Thread Avi Gross via Python-list
Is there a more general idea here? How about asking for a control that internally manages N items and requires exactly M of them before the entry is accepted when you click? The case being discussed sort of wants N out of N, or nothing. Example, you order a family dinner from a Restaurant and are

RE: name for a mutually inclusive relationship

2021-02-25 Thread Avi Gross via Python-list
just a category that could be doable. -Original Message- From: Python-list On Behalf Of Chris Angelico Sent: Thursday, February 25, 2021 1:14 AM To: Python Subject: Re: name for a mutually inclusive relationship On Thu, Feb 25, 2021 at 4:06 PM Avi Gross via Python-list wrote: > > Is

Re: error of opening Python

2021-02-25 Thread Alan Gauld via Python-list
On 25/02/2021 17:22, Botao Liu wrote: > Type "help", "copyright", "credits" or "license" for more information." Follow the instructions and type "help" at the >>> prompt. Then follow the instructions which it displays. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/

Re: error of opening Python

2021-02-25 Thread Mladen Gogala via Python-list
On Thu, 25 Feb 2021 17:22:35 +, Botao Liu wrote: > Dear Python team, > > This is my first time using Python, I tried to launch Python and it > showed "Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC > v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or > "lic

Re: name for a mutually inclusive relationship

2021-02-26 Thread Alan Gauld via Python-list
On 26/02/2021 04:30, Ethan Furman wrote: >> Do you have a specific problem you're trying to solve? > > No, I just came across the concept in my browsing and > was wondering if there was a name for it. If we stick with boolean values (like radio buttons and checkboxes) then I think the name is

Re: error of opening Python

2021-02-26 Thread Mladen Gogala via Python-list
On Fri, 26 Feb 2021 02:23:51 -0500, Terry Reedy wrote: > Not on Windows. Please don't spew misleading garbage that will only > confuse the new user on a different operating system. > You are right, I apologize. I sort of like poking fun at the Winduhs users but this is not the right place.

Re: Tkinter needed as a legacy version 2.7 imports the module...

2021-02-27 Thread Alan Gauld via Python-list
On 26/02/2021 22:23, Kevin M. Wilson via Python-list wrote: > Hey Community,    Is there a site where I might/can download a version of > Tkinter for Python 2.7? Which OS? If it's Linux you may need to fetch the tkinter package for your distro. In Windoze it should come as s

yield from () Was: Re: weirdness with list()

2021-03-01 Thread Alan Gauld via Python-list
On 28/02/2021 00:17, Cameron Simpson wrote: > BUT... It also has a __iter__ value, which like any Box iterates over > the subboxes. For MDAT that is implemented like this: > > def __iter__(self): > yield from () Sorry, a bit OT but I'm curious. I haven't seen this before: yield fro

Re: yield from () Was: Re: weirdness with list()

2021-03-02 Thread Alan Gauld via Python-list
On 28/02/2021 23:47, Alan Gauld via Python-list wrote: > On 28/02/2021 00:17, Cameron Simpson wrote: > >> BUT... It also has a __iter__ value, which like any Box iterates over >> the subboxes. For MDAT that is implemented like this: >> >> def __iter_

Re: is not recognized as an internal or external command, operable program or batch file.

2021-03-02 Thread Roland Mueller via Python-list
he-windows-path ma 1. maalisk. 2021 klo 20.54 singh.veer99999--- via Python-list ( [email protected]) kirjoitti: >Dear Sir/Madam > >Sir I am facing the issue from 10 days. And I tried all the ways to > remove >this or to come out of this problem >but as i t

a + not b

2021-03-03 Thread Rob Cliffe via Python-list
I can't work out why     1 + - 1     1 + (not 1) are legal syntax, but     1 + not 1 isn't. Is there a good reason for this? Thanks Rob Cliffe -- https://mail.python.org/mailman/listinfo/python-list

RE: a + not b

2021-03-03 Thread Avi Gross via Python-list
" and just before "and" and "or" so you need parentheses to force the interpretation you may intend. Similarly, some used of "and" require parentheses as do other operators. -----Original Message- From: Python-list On Behalf Of Rob Cliffe via Python-list

RE: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Avi Gross via Python-list
Just to be clear, and luckily the person who posed such boasts is luckily gone and I AM NOT interested in having the discussion again here, I have a point to make. He did not suggest a magical compiler that could translate any language. Not exactly. I think he suggested that if all languages shar

RE: Apriori Algorithm

2021-03-06 Thread Avi Gross via Python-list
"I want to make apriori algorithm from start. Anybody have any reference file?" Excellent question. Based on everything you shared, I think all I can offer is that whatever you do, do not make the aposteriori version. Or, you could consider asking a real question with enough detail that m

How to implement logging for an imported module?

2021-03-07 Thread Robert Latest via Python-list
Hello, I'm trying to add logging to a module that gets imported by another module. But I only get it to work right if the imported module knows the name of the importing module. The example given in the "Logging Cookbook" also rely on this fact. https://docs.python.org/3/howto/logging-cookbook.ht

RE: Apriori Algorithm

2021-03-07 Thread Avi Gross via Python-list
s but needs to become some kind of data structure such as a list of tuples or whatever the algorithm wants. -Original Message- From: Python-list On Behalf Of dn via Python-list Sent: Sunday, March 7, 2021 3:09 AM To: [email protected] Subject: Re: Apriori Algorithm On 07/03/2021 20.56, s

RE: neonumeric - C++ arbitrary precision arithmetic library

2021-03-07 Thread Avi Gross via Python-list
king anything, but I think a universal translator may not be imminent. -Original Message- From: Python-list On Behalf Of Peter J. Holzer Sent: Sunday, March 7, 2021 2:43 PM To: [email protected] Subject: Re: neonumeric - C++ arbitrary precision arithmetic library On 2021-03-06 23:4

RE: Apriori Algorithm

2021-03-07 Thread Avi Gross via Python-list
ee of what looks like integers is a > grouping you want to contrast to other such lines in the algorithm? I > doubt it can be used as is but needs to become some kind of data > structure such as a list of tuples or whatever the algorithm wants. > -Original Message----- > From: Pyth

Re: python curses constant names for mouse wheel movements?

2021-03-07 Thread Alan Gauld via Python-list
On 07/03/2021 07:16, [email protected] wrote: > Where can I find any documentation of the correct curses constant name(s) to > use for detecting a "wheel down" action? Or do I just have to manually > define my own BUTTON5 constant name for the wheel-down event? I suspect you need to look i

Re: How to implement logging for an imported module?

2021-03-08 Thread Robert Latest via Python-list
Joseph L. Casale wrote: >> I couldn't find any information on how to implement logging in a library that >> doesn't know the name of the application that uses it. How is that done? > > That's not how it works, it is the opposite. You need to know the name of its > logger, and since you imported it,

Re: python curses constant names for mouse wheel movements?

2021-03-09 Thread Alan Gauld via Python-list
On 09/03/2021 01:05, [email protected] wrote: > I am replying to my own message due to the digest not appearing in my inbox > yet today. I will add Alan Gould's responses and my reply to him manually. > Yes, when I talk about wheel up/down I do mean wheel rotation events, not > wheel-button

Application problems

2021-03-10 Thread Yoosuf Oluwatosin via Python-list
I have downloaded python 3.9.2 on my hp laptop with windows 10 and tried opening both the normal python and the idle python on my pc but the norml keeps opening the modify, repair and uninstall page while the idle keeps giving a startup error. I have uninstalled, deleted and reinstalled severa

REPL peculiarity

2021-03-11 Thread Rob Cliffe via Python-list
This is a valid Python program: def f(): pass print(f) But at the REPL: >>> def f(): pass ... print(f)   File "", line 2     print(f)     ^ SyntaxError: invalid syntax It doesn't seem to matter what the second line is.  In the REPL you have to leave a blank line after the "def" line.  Why? T

Re: REPL peculiarity

2021-03-11 Thread Alan Gauld via Python-list
On 11/03/2021 11:01, Rob Cliffe via Python-list wrote: > This is a valid Python program: > > def f(): pass > print(f) > > But at the REPL: > > >>> def f(): pass > ... print(f) >   File "", line 2 >     print(f) >     ^ > SyntaxErr

IDLE python

2021-03-11 Thread Yoosuf Oluwatosin via Python-list
I have tried to startup my IDLE python severally but it keeps giving the following message: IDLE’s subprocess didn’t make connection. See the ‘Startup Failure’ section of the IDLE doc online at https://docs.python.org/3/library/idle.html#startup-failure. I have gone to the page and followed a

Re: Why assert is not a function?

2021-03-15 Thread Robert Latest via Python-list
Chris Angelico (and oters) wrote: [interesting stuff] I'm a late contributor here, but I'd just say: If you'd prefer a function for assert, just define a function that does what you want and be done with it. Much harder to do if assert() were a built-in function but you'd rather have a keyword ;-

Re: How to implement logging for an imported module?

2021-03-15 Thread Robert Latest via Python-list
Richard Damon wrote: > On 3/8/21 4:16 AM, Robert Latest via Python-list wrote: >> Joseph L. Casale wrote: >>>> I couldn't find any information on how to implement logging in a library >>>> that doesn't know the name of the application that uses it. H

Re: A 35mm film camera represented in Python object

2021-03-15 Thread Robert Latest via Python-list
D.M. Procida wrote: > Hi everyone, I've created - > a representation of a Canonet G-III QL17 in Python. [...] > The Canonet G-III QL17 is one of my favourites. One of my reasons for > writing this code is to appreciate the intricate mechanical logic >

Re: How do I read .csv files

2021-03-16 Thread Alan Gauld via Python-list
On 16/03/2021 16:15, The Cool Life wrote: > Try importing the CSV module. That might help! And for the removal of doubt it is spelled csv 9lower case) And it looks like you want to read about the DictReader class within it. The csv module docs include several examples. -- Alan G Author of the L

[SQLAlchemy] Struggling with association_proxy

2021-03-18 Thread Robert Latest via Python-list
I'm trying to implement a many-to-many relationship that associates Baskets with Items via an association object called Link which holds the quantity of each item. I've done that in SQLAlchemy in a very pedestrian way, such as when I want to have six eggs in a basket: 1. Find ID of Item with name

Re: .title() - annoying mistake

2021-03-19 Thread Karen Shaeffer via Python-list
> On Mar 19, 2021, at 9:42 AM, Grant Edwards wrote: > > On 2021-03-19, Skip Montanaro wrote: >>> >>> That's annoying. You have to roll your own solution! >>> >> >> Certainly seems like a known issue: >> >> https://bugs.python.org/issue12737 > > While that is an issue with string.title(),

Re: .title() - annoying mistake

2021-03-19 Thread Alan Gauld via Python-list
On 19/03/2021 19:58, Dan Stromberg wrote: > In high school, I was taught that English has multiple capitalization > rulesets to choose among for titles. > And, of course, there are multiple forms of English. English English is very different from US English. And even in the UK there are (a few,

Re: .title() - annoying mistake

2021-03-20 Thread Robert Latest via Python-list
Mats Wichmann wrote: > The problem is that there isn't a standard for title case, The problem is that we owe the very existence of the .title() method to too much weed being smoked during Python development. It makes specific assumptions about a specific use case of one specific language. It doesn

Re: .title() - annoying mistake

2021-03-20 Thread Jon Ribbens via Python-list
On 2021-03-20, Cameron Simpson wrote: > On 20Mar2021 12:53, Sibylle Koczian wrote: >>Am 20.03.2021 um 09:34 schrieb Alan Bawden: >>>The real reason Python strings support a .title() method is surely >>>because Unicode supports upper, lower, _and_ title case letters, and >>>tells you how to map be

Re: .title() - annoying mistake

2021-03-21 Thread Robert Latest via Python-list
Chris Angelico wrote: > On Sun, Mar 21, 2021 at 4:31 AM Robert Latest via Python-list > wrote: >> >> Mats Wichmann wrote: >> > The problem is that there isn't a standard for title case, >> >> The problem is that we owe the very existence of the .tit

Re: .title() - annoying mistake

2021-03-21 Thread Robert Latest via Python-list
Benjamin Schollnick wrote: > > I’m sorry Robert, but just because it doesn’t meet your requirements, doesn’t > mean it’s useless. > > I use .title to normalize strings for data comparison, all the time. It’s a > perfect alternative to using .UPPER or .lower. > > Right in the documentation, it sp

Re: .title() - annoying mistake

2021-03-21 Thread Robert Latest via Python-list
Chris Angelico wrote: > On Sun, Mar 21, 2021 at 10:31 PM Robert Latest via Python-list > wrote: >> Yes, I get that. But the purpose it (improperly) serves only makes sense in >> the English language. > > Why? Do titles not exist in other languages? Does no other language &g

Re: .title() - annoying mistake

2021-03-22 Thread Robert Latest via Python-list
Benjamin Schollnick wrote: > >> I agree with everything you say. Especially the open source part. But >> wouldn't you agree that .title() with all its arbitrary specificity to >> appear in the very core of a general purpose language is quite an oddity? > > No, because it book ends the issue. > > Up

Re: .title() - annoying mistake

2021-03-22 Thread Robert Latest via Python-list
Grant Edwards wrote: > On 2021-03-20, Robert Latest via Python-list wrote: >> Mats Wichmann wrote: >>> The problem is that there isn't a standard for title case, >> >> The problem is that we owe the very existence of the .title() method to too >> much we

How to set up a 'listening' Unix domain socket

2021-03-22 Thread Robert Latest via Python-list
Hello, I'm trying to set up a server that receives data on a Unix domain socket using the code below. import os from socketserver import UnixStreamServer, StreamRequestHandler SOCKET = '/tmp/test.socket' class Handler(StreamRequestHandler): def handle(self): data = selr.rfile.read() print(

Re: .title() - annoying mistake

2021-03-22 Thread Robert Latest via Python-list
Chris Angelico wrote: > If you still, after all these posts, have not yet understood that > title-casing *a single character* is a significant thing, I must admit I have no idea what title-casing even is, but I'm eager to learn. The documentation only talks about "words" and "first characters" and

Re: How to set up a 'listening' Unix domain socket

2021-03-22 Thread Robert Latest via Python-list
Chris Angelico wrote: > > Hmm, your formatting's messed up, but the code looks fine to me. (Be aware > that you seem to have a "selr" where it should be "self".) Didn't catch that because my program didn't even get to that point ;-) > >> However, when I try to send somthing to that socket, I get

Re: .title() - annoying mistake

2021-03-22 Thread Robert Latest via Python-list
Chris Angelico wrote: > There are a small number of characters which, when case folded, become > more than one character. The sharp S from German behaves thusly: > "ß".upper(), "ß".lower(), "ß".casefold(), "ß".title() > ('SS', 'ß', 'ss', 'Ss') Now we're getting somewhere. I'm a native German

Re: .title() - annoying mistake

2021-03-22 Thread Robert Latest via Python-list
Karsten Hilbert wrote: > and life with that wart. Perfectly willing to as long as everybody agrees it's a wart ;-) robert -- https://mail.python.org/mailman/listinfo/python-list

Re: How to set up a 'listening' Unix domain socket

2021-03-22 Thread Robert Latest via Python-list
> Chris Angelico wrote: [Helpful stuff] I'm actually trying to implement a SocketHandler for a Python logger. However, I can't get my handler on the client side to send anything. Do I need to subclass logging.SocketHandler and fill the various methods with meaning? The documentation doesn't say s

Re: .title() - annoying mistake

2021-03-22 Thread Robert Latest via Python-list
Chris Angelico wrote: > Cool thing is, nobody in Python needs to maintain anything here. That's great because I'm actually having trouble with sending log messages over the socket conection you helped me with, would you mind having a look? Regards, robert -- https://mail.python.org/mailman/listi

Re: .title() - annoying mistake

2021-03-22 Thread Karen Shaeffer via Python-list
Hi Chris, Thanks for your comment. > Python doesn't work with UTF-8 encoded code points; it works with > Unicode code points. Are you looking for something that checks whether > something is a palindrome, or locates palindromes within it? > > def is_palindrome(txt): >return txt == txt[::-1] >

Re: .title() - annoying mistake

2021-03-22 Thread Robert Latest via Python-list
Benjamin Schollnick wrote: > I’m sorry, but it’s as if he’s arguing for the sake of arguing. It’s > starting to feel very unproductive, and unnecessary. That was never five minutes just now! robert -- https://mail.python.org/mailman/listinfo/python-list

RE: .title() - annoying mistake

2021-03-22 Thread Avi Gross via Python-list
Speaking for myself, I am beyond tired of this topic, however informative parts have been. I will say it is irrational to try to impose rationally across all possible languages, let alone people like me who often combine 3 or more language in a single sentence when talking to others like myself wi

RE: convert script awk in python

2021-03-23 Thread Avi Gross via Python-list
Alberto, To convert any algorithm to python (or anything else) you have to understand it. Do you know what AWK is doing? And does the darn thing work already in awk? Why do you need to convert it? My suspicion is that it has errors and if so, it is NOT about converting at all. I will not solve th

RE: convert script awk in python

2021-03-24 Thread Avi Gross via Python-list
anslator by just saving some JSON descriptions? -Original Message- From: Python-list On Behalf Of Cameron Simpson Sent: Tuesday, March 23, 2021 6:38 PM To: Tomasz Rola Cc: Avi Gross via Python-list Subject: Re: convert script awk in python On 23Mar2021 16:37, Tomasz Rola wrote: >On Tue, M

Re: convert script awk in python

2021-03-24 Thread Alan Gauld via Python-list
On 23/03/2021 14:40, Avi Gross via Python-list wrote: > $1 == 113 { > if (x || y || z) > print "More than one type $8 atom."; > else { > x = $2; y = $3; z = $4; > istep++; > } > } > > I am a tod concerned as to where

RE: convert script awk in python

2021-03-24 Thread Avi Gross via Python-list
n-list On Behalf Of Alan Gauld via Python-list Sent: Wednesday, March 24, 2021 5:28 AM To: [email protected] Subject: Re: convert script awk in python On 23/03/2021 14:40, Avi Gross via Python-list wrote: > $1 == 113 { > if (x || y || z) > print "More than one ty

Re: convert script awk in python

2021-03-24 Thread Alan Gauld via Python-list
On 24/03/2021 16:00, Avi Gross via Python-list wrote: > But I wonder how much languages like AWK are still used to make new programs > as compared to a time they were really useful. True. I first discovered awk from a Byte article around 1988/9 and it became my goto tool for text munching

RE: convert script awk in python

2021-03-24 Thread Avi Gross via Python-list
Just to be clear, Cameron, I retired very early and thus have had no reason to use AWK in a work situation and for a while was not using UNIX-based machines. I have no doubt I would have continued using WK as one part of my toolkit for years albeit less often as I found other tools better for some

RE: convert script awk in python

2021-03-26 Thread Avi Gross via Python-list
Michael, A generator that opens one file at a time (or STDIN) in a consistent manner, would be a reasonable thing to have as part of emulating AWK. As I see it, you may want a bit more that includes having it know how to parse each line it reads into some version of names that in Python might not

RE: convert script awk in python

2021-03-26 Thread Avi Gross via Python-list
plit! ∀vi ∃. Grθß -Original Message- From: Python-list On Behalf Of [email protected] Sent: Friday, March 26, 2021 9:43 PM To: [email protected] Subject: Re: convert script awk in python On 2021-03-26 at 21:06:19 -0400, Avi Gross via Python-list wrote: > A generat

RE: python documentation

2021-03-27 Thread Avi Gross via Python-list
What are the odds, Chris, that rewriting an existing project written in an older version of a language like python FROM SCRATCH into any other existing language, would be easier than updating it to the same language which made fairly specific changes and has some guidelines how to update? True, if

Re: Canonical conversion of dict of dicts to list of dicts

2021-03-30 Thread Jon Ribbens via Python-list
On 2021-03-30, Loris Bennett wrote: > If I have dict of dicts, say > > dod = { > "alice": > { > "lang": "python", > "level": "expert" > }, > "bob": > { > "lang": "perl", > "level": "noob" > } > } > > is there a canonic

Re: Canonical conversion of dict of dicts to list of dicts

2021-03-30 Thread Jon Ribbens via Python-list
On 2021-03-30, Chris Angelico wrote: > I dunno about "canonical", but here's how I'd do it: > > lod = [info | {"name": name} for name, info in dod.items()] > > You could use {"name":name}|info instead if you prefer to have the > name show up first in the dictionary. It's probably worth noting thi

Re: Canonical conversion of dict of dicts to list of dicts

2021-03-30 Thread Jon Ribbens via Python-list
On 2021-03-30, Chris Angelico wrote: > On Tue, Mar 30, 2021 at 11:01 PM Jon Ribbens via Python-list > wrote: >> >> On 2021-03-30, Chris Angelico wrote: >> > I dunno about "canonical", but here's how I'd do it: >> > >> > lod = [i

Re: memory consumption

2021-03-30 Thread Alan Gauld via Python-list
On 29/03/2021 11:12, Alexey wrote: > Hello everyone! > I'm experiencing problems with memory consumption. > The first thing you really need to tell us is which OS you are using? Memory management varies wildly depending on OS. Even different flavours of *nix do it differently. However, most do i

Ann: New Python curses book

2021-03-30 Thread Alan Gauld via Python-list
I've just published, in Kindle and paperback formats, my book on "Programming curses with Python". https://www.amazon.co.uk/dp/B091B85B77/ (It should be available in most other Amazon stores too) It is a complete rewrite of the Linux Documentation Project's HowTo for the C ncurses library. It ha

RE: New Python curses book

2021-03-30 Thread Avi Gross via Python-list
preview of the beginning parts and see it is about programming, hold the curses. -Original Message- From: Python-list On Behalf Of Alan Gauld via Python-list Sent: Tuesday, March 30, 2021 7:12 AM To: [email protected] Subject: Ann: New Python curses book I've just published, in K

Re: Ann: New Python curses book

2021-03-30 Thread Alan Gauld via Python-list
On 30/03/2021 17:14, Grant Edwards wrote: > Is the kindle format readable via a web browser pointed at > read.amazon.com (AKA "Kindle Cloud Reader)? It seems to be, I downloaded the free sample and could read the first 2 chapters on the web reader. -- Alan G Author of the Learn to Program web s

RE: Ann: New Python curses book

2021-03-30 Thread Avi Gross via Python-list
and cures" ... So depending on what country you are interested in, it may well be there but you need to not use the supplied URL and go there directly. -Original Message- From: Python-list On Behalf Of William Ray Wing via Python-list Sent: Tuesday, March 30, 2021 2:06 PM To: Python

Re: New Python curses book

2021-03-30 Thread Brian Oney via Python-list
March 30, 2021 6:35:20 PM GMT+02:00, Chris Angelico wrote: >On Wed, Mar 31, 2021 at 3:21 AM Avi Gross via Python-list > wrote: >> >> Congratulations, Alan, on the book. >> >> I continue to wonder if people will buy the book for the wrong reason or ban >> it t

Re: memory consumption

2021-03-30 Thread Alan Gauld via Python-list
On 30/03/2021 16:50, Chris Angelico wrote: >> A 1GB process on modern computers is hardly a big problem? >> Most machines have 4G and many have 16G or even 32G >> nowadays. >> > > Desktop systems maybe, but if you rent yourself a worker box, it might > not have anything like that much. Especially

Re: Ann: New Python curses book

2021-03-30 Thread Alan Gauld via Python-list
On 30/03/2021 19:52, Grant Edwards wrote: > It is. I just bought the kindle version on the US site, and it renders > fine in the cloud reader. It would be cool if you could cut/paste code > examples from the book into IDLE or a text editor, but I've never been > able to get the cloud reader to all

Re: New Python curses book

2021-03-30 Thread Alan Gauld via Python-list
On 30/03/2021 20:05, Brian Oney via Python-list wrote: > Congratulations! > > Indeed, I was wondering for a moment if this was a guide to al dente > spaghetti code. With each curse being a funny way to mess with the colleagues > performing the code review ;) You may jest b

Source code link was: Re: Ann: New Python curses book

2021-03-31 Thread Alan Gauld via Python-list
On 31/03/2021 00:09, Alan Gauld via Python-list wrote: > Watch this space. Hopefully tomorrow. The source code is now available in a zip file at: http://www.alan-g.me.uk/hills/PythonCursesCode.zip Or via a link on the programming section of my home page http://www.alan-g.me.uk/ It

Re: memory consumption

2021-03-31 Thread Rob Cliffe via Python-list
On 31/03/2021 09:35, Alexey wrote: среда, 31 марта 2021 г. в 01:20:06 UTC+3, Dan Stromberg: What if you increase the machine's (operating system's) swap space? Does that take care of the problem in practice? I can`t do that because it will affect other containers running on this host. In my

XanaNews Statistic for comp.lang.python. 4/1/2021 5:52:47 AM

2021-04-01 Thread The Doctor via Python-list
XanaNews Statistic for comp.lang.python. 4/1/2021 5:52:47 AM >From article 587730 (3/1/2021 4:09:02 AM) to article 588588 (3/31/2021 11:40:40 PM) Number of threads ... 385 Number of articles .. 895 Average articles per thread . 2.32 Number of unanswered

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-01 Thread Alan Gauld via Python-list
On 01/04/2021 00:14, Chris Angelico wrote: > On a scale of 1 to "submit this to The Daily WTF immediately", how bad > is this code? :) The only worthwhile test of code quality is whether a new member of the team, competent in the language but not an expert can understand the code in two readings

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread Alan Gauld via Python-list
On 02/04/2021 00:42, dn via Python-list wrote: > Contrarily "tuck" in (old) English slang represented "sweets" (or Not that old. We still use it occasionally today. And we certainly had a "tuck shop" at school. It was where you bought lunch if not eating in the

RE: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread Avi Gross via Python-list
, 2021 8:00 PM To: Python Subject: Re: Horrible abuse of __init_subclass__, or elegant hack? On Fri, Apr 2, 2021 at 10:43 AM dn via Python-list wrote: > > On 02/04/2021 10.13, Chris Angelico wrote: > > Well, it's a simple matter of chronology. First you have crude oil, > >

Re: Friday Finking: initialising values and implied tuples

2021-04-02 Thread Rob Cliffe via Python-list
On 02/04/2021 23:10, dn via Python-list wrote: (f) the space-saver: resource = "Oil"; time = 1; crude = 2; residue = 3; my_list = "long" IMO This can be OK when the number of items is VERY small (like 2) and not expected to increase (or decrease).  Especially if

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread Alan Gauld via Python-list
On 02/04/2021 21:33, dn via Python-list wrote: > Bournville was the only Cadbury chocolate I would > consider. Today, even that seems to lack Cadbury has always been a budget chocolate brand(*) here; its a mass market option loaded with sugar and little else. Certainly doesn't

Re: Friday Finking: initialising values and implied tuples

2021-04-02 Thread Alan Gauld via Python-list
On 02/04/2021 23:10, dn via Python-list wrote: > When there are several items to be defined and initialised, how do you > prefer to format the code, and why? > (a) basic linear presentation: > > resource = "Oil" > time = 1 > crude = 2 > residue = 3 > my_

Re: Friday Finking: initialising values and implied tuples

2021-04-03 Thread Rob Cliffe via Python-list
On 03/04/2021 04:09, [email protected] wrote: On 2021-04-03 at 02:41:59 +0100, Rob Cliffe via Python-list wrote:     x1 = 42; y1 =  3;  z1 = 10     x2 = 41; y2 = 12; z2 = 9     x3 =  8;  y3 =  8;  z3 = 10 (please imagine it's in a fixed font with everything n

Re: Friday Finking: initialising values and implied tuples

2021-04-05 Thread Rob Cliffe via Python-list
On 05/04/2021 00:47, dn via Python-list wrote: On 04/04/2021 01.00, Rob Cliffe via Python-list wrote: On 03/04/2021 04:09, [email protected] wrote: On 2021-04-03 at 02:41:59 +0100, Rob Cliffe via Python-list wrote: x1 = 42; y1 =  3;  z1 = 10 x2 = 41; y2 = 12

Re: Friday Finking: initialising values and implied tuples

2021-04-05 Thread Rob Cliffe via Python-list
On 05/04/2021 17:52, Chris Angelico wrote: On Tue, Apr 6, 2021 at 2:32 AM Rob Cliffe via Python-list wrote: It doesn't appear to, at least not always. In Python 3.8.3: from dis import dis def f(): x = 1 ; y = 2 def g(): (x,y) = (1,2) dis(f) dis(g) Output: 2 0 LOAD_

Re: Friday Finking: initialising values and implied tuples

2021-04-05 Thread Rob Cliffe via Python-list
On 05/04/2021 17:52, Chris Angelico wrote: I don't understand.  What semantic difference could there be between     x = { 1: 2 }    ;    y = [3, 4]   ;   z = (5, 6) and     x, y, z = { 1:2 }, [3, 4], (5, 6) ?  Why is it not safe to convert the latter to the former? But I withdraw "set" from my "

Re: Friday Finking: initialising values and implied tuples

2021-04-05 Thread Rob Cliffe via Python-list
On 05/04/2021 18:33, Chris Angelico wrote: Firstly, anything with any variable at all can involve a lookup, which can trigger arbitrary code (so "variables which do not occur on the LHS" is not sufficient). Interesting.  I was going to ask: How could you make a variable lookup trigger arbitra

<    22   23   24   25   26   27   28   29   30   31   >