RE: Bloody rubbish

2021-05-06 Thread Avi Gross via Python-list
Actually, Joe, putting in any serious program using toggle switches without anything like a BACKSPACE was very hard as I often had to abort and start again. Doing it twice the same way, Argh Luckily, I only had to do it a few times to learn just like I had to write assembler programs o

RE: learning python ...

2021-05-24 Thread Avi Gross via Python-list
I have studied many programming languages and am amused when people attack python as if every other language is somehow more optimal. Cameron and others have provided examples but look at positives AND negatives. Yes code like: num = int(num) does look a tad off as it reuses the same name for s

RE: learning python ...

2021-05-27 Thread Avi Gross via Python-list
ubject: Re: learning python ... When the idea is to learn something, it's not exactly helpful to abandon that idea when encountering the first obstacle or when someone tells you you don't like it as much as they do ... On 5/25/21 7:56 AM, Avi Gross via Python-list wrote: > I have studi

RE: Definition of "property"

2021-05-30 Thread Avi Gross via Python-list
You guys are all very knowledgeable but he is asking what to say to an EDITOR who clearly may know little or nothing about computers and thinks python is a snake and not a language and may need to be spoken to in his own language which understands other forms of abstraction better. So, just for hu

RE: Why the list creates in two different ways? Does it cause by the mutability of its elements? Where the Python document explains it?

2021-06-15 Thread Avi Gross via Python-list
May I ask if there are any PRACTICAL differences if multiple immutable tuples share the same address or not? I mean if I use a tuple in a set or as the key in a dictionary and a second one comes along, will it result in two entries one time and only one the other time? Some languages I use often

RE: Why the list creates in two different ways? Does it cause by the mutability of its elements? Where the Python document explains it?

2021-06-15 Thread Avi Gross via Python-list
sday, June 15, 2021 9:00 PM To: python-list@python.org Subject: Re: Why the list creates in two different ways? Does it cause by the mutability of its elements? Where the Python document explains it? On 16/06/21 12:15 pm, Avi Gross wrote: > May I ask if there are any PRACTICAL differences if multi

RE: Optimizing Small Python Code

2021-06-22 Thread Avi Gross via Python-list
I had a similar question, Greg. Optimized for what, indeed. Some might suggest removing a VISIBLE loop is an optimization and some might not. First you need to look at what your code does. It is fairly primitive. Here is a two-line version but is it simpler: for n in range(1, 7): print (n,

RE: Optimizing Small Python Code

2021-06-23 Thread Avi Gross via Python-list
n 23/06/2021 08.17, Stefan Ram wrote: > "Avi Gross" writes: >> This can be made a one-liner too! LOL! > > print( '1\n 0\n2\n 0\n 1\n3\n 0\n 1\n 2\n4\n 0\n 1\n 2\n 3\n5\n 0\n 1\n 2\n 3\n 4\n6\n 0\n 1\

RE: Optimizing Small Python Code

2021-06-24 Thread Avi Gross via Python-list
pare the output will be fooled. -Original Message- From: jan Sent: Thursday, June 24, 2021 3:01 AM To: Avi Gross Cc: python-list@python.org Subject: Re: Optimizing Small Python Code If I'm not mistaken, the original output is O(n^2) in quantity of chars, and as output time is propo

RE: Optimizing Small Python Code

2021-06-24 Thread Avi Gross via Python-list
primes that hard way. Final note is there is not much in the discussion that is really about Python as much of the argument remains similar in many programming languages. So, I am done and will ignore this thread. From: Barry Scott Sent: Thursday, June 24, 2021 3:12 PM To: Avi Gross Cc: py

RE: Searching pypi.org, is there an 'advanced search'?

2021-07-17 Thread Avi Gross via Python-list
Chris, Just a bit off topic, but google does have some advanced features such as using the word AND or putting something in quotes to make it search for the combination written the same way. Some of the tricks work for other search engines too. Google does have an advanced search feature here

RE: a simple question

2021-07-26 Thread Avi Gross via Python-list
In addition to the other requests for more info on a very ambiguous question, let me add one. Did the message suggest something worked on an earlier version and broke with a new version, or did they mean they just started USING the current version and hoped the version number was meaningful for the

RE: some problems for an introductory python test

2021-08-11 Thread Avi Gross via Python-list
This conversation has, of course, veered away from the original question so I am starting afresh. My memory of the original question is about how one sets up a test for material covered in class or associated materials for what sounds like a beginner class. I am not sure whether this would be the

RE: on writing a while loop for rolling two dice

2021-08-28 Thread Avi Gross via Python-list
And there is the ever popular recursive version you call with no while loop in sight. And, oddly, no variable declared in your main body: # CODE START --- import random def roll2(): return random.randint(1,6), random.randint(1,6) def roll_equal(counter): first, second = roll2() e

RE: urgent (actually NOT urgent at all.)

2021-08-31 Thread Avi Gross via Python-list
This is a bit sillier then some other discussions here! There are many programs (especially back when more command-line programs were used) that presented default prompts like "$" and many or most of them let you over-ride it. Can someone tell this person that if >>> is not pleasing, they can d

RE: on writing a while loop for rolling two dice

2021-09-06 Thread Avi Gross via Python-list
For some people the "while true" method seems reasonable but it has a problem if the internal body does not have some guarantee of an exit. And that exit can be subtle. Many have mentioned ways an end condition can fail due to rounding errors not being exactly equal to what you are looking for, or

RE: on writing a while loop for rolling two dice

2021-09-06 Thread Avi Gross via Python-list
I actually like it if a language lets you spell out your intention, although adding many keywords is not a plus. So, yes something like: loop ... end loop; Is appealing as it makes clear the decision on when to exit the loop must be within the loop (or till some

RE: on writing a while loop for rolling two dice

2021-09-06 Thread Avi Gross via Python-list
ting a while loop for rolling two dice "Avi Gross" writes: >For some people the "while true" method seems reasonable but it has a >problem if the internal body does not have some guarantee of an exit. >And A programming error where the condition used does not express

RE: on writing a while loop for rolling two dice

2021-09-06 Thread Avi Gross via Python-list
python-list@python.org Subject: Re: on writing a while loop for rolling two dice On 2021-09-06 at 20:11:41 -0400, Avi Gross via Python-list wrote: > And in the python version, has anyone made a generator that returned > NULL or the like so you can say uselessly: > > for ( _ in forever(

RE: on writing a while loop for rolling two dice

2021-09-06 Thread Avi Gross via Python-list
ython-list@python.org Subject: Re: on writing a while loop for rolling two dice "Avi Gross" writes: > In languages like C/C++ there are people who make up macros like: >#define INDEFINITELY_LOOP while (true) >Or something like that and then allow the preprocessor to replace >IND

RE: on writing a while loop for rolling two dice

2021-09-07 Thread Avi Gross via Python-list
alister via Python-list Sent: Tuesday, September 7, 2021 2:58 PM To: python-list@python.org Subject: Re: on writing a while loop for rolling two dice On Tue, 07 Sep 2021 14:53:29 +, Grant Edwards wrote: > On 2021-09-06, Stefan Ram wrote: >> "Avi Gross" writes: >&g

RE: on writing a while loop for rolling two dice

2021-09-07 Thread Avi Gross via Python-list
Greg, Yes, a smart person may come up with such tricks but a really smart person, in my view, adjusts. With some exceptions, such as when trying to port existing code to a new language quickly, someone who is not too obsessive will try to pick up the goals and spirit of a new language and use them

RE: on writing a while loop for rolling two dice

2021-09-07 Thread Avi Gross via Python-list
another object means you over-rode the meaning of += for instance. -Original Message- From: Python-list On Behalf Of Richard Damon Sent: Tuesday, September 7, 2021 10:09 PM To: python-list@python.org Subject: Re: on writing a while loop for rolling two dice On 9/7/21 3:51 PM, Avi Gross via

RE: on writing a while loop for rolling two dice

2021-09-08 Thread Avi Gross via Python-list
Charles, This forum is for python discussions so I will clarify that there is nothing wrong with making up a new language, including by bootstrapping an old language. But why not call it new and do not try to confuse people using the old. Python has grown and added much over the years and even ha

RE: Friday Finking: Contorted loops

2021-09-10 Thread Avi Gross via Python-list
So why use the word "else" when it really does not mean what users consider else? Again, we have words like "finally" used in some places to mean it should be done no matter what, like closing a file that may be open. What phrase used either in one or all contexts might have been better, if longe

RE: Friday Finking: Contorted loops

2021-09-10 Thread Avi Gross via Python-list
In this discussion, I shudder to mention that people often simply use all kinds of additional logic to get a result. How much code have you seen that has some variable like "completed = False" that can be set to True in multiple places and many areas inside the loop are enclosed in an IF stateme

RE: Friday Finking: Contorted loops

2021-09-11 Thread Avi Gross via Python-list
Alan and others, I think human languages used to make computer languages will often cause confusion. Some languages have an IF .. ELSE construct but also an EITHER ... OR and a NEITHER ... NOR and other twists and turns like words that sometimes come apart and you end up having to dangle a part

RE: Friday Finking: Contorted loops

2021-09-11 Thread Avi Gross via Python-list
Peter, in your own personal finite sample, I am wondering what you might do TODAY if you looked at your loops again and considered redoing them for an assortment of reasons ranging from using the code for teaching to efficiency to just fitting your mood better? I have seen seasoned authors go back

RE: Friday Finking: Contorted loops

2021-09-12 Thread Avi Gross via Python-list
: Sunday, September 12, 2021 5:44 AM To: python-list@python.org Subject: Re: Friday Finking: Contorted loops On 2021-09-11 21:38:02 -0400, Avi Gross via Python-list wrote: > Peter, in your own personal finite sample, I am wondering what you > might do TODAY if you looked at your loops aga

RE: Friday Finking: Contorted loops

2021-09-12 Thread Avi Gross via Python-list
needs to do things in the current environment and thus only part of the functionality can be moved away. -Original Message- From: Python-list On Behalf Of Stefan Ram Sent: Saturday, September 11, 2021 10:56 PM To: python-list@python.org Subject: Re: Friday Finking: Contorted loops &quo

RE: Friday Finking: Contorted loops

2021-09-12 Thread Avi Gross via Python-list
Some of what I read makes me chuckle. Yes, large units of code, and even smaller ones, may be a chore to figure out. Arguably harder when you use indentation and the next/last parts are not even on the same screen as the rest. Sometimes you want to use a split-screen in some editor to line up the

RE: Friday Finking: Contorted loops

2021-09-13 Thread Avi Gross via Python-list
on.org Subject: Re: Friday Finking: Contorted loops On 2021-09-12 17:11:58 -0400, Avi Gross via Python-list wrote: > Yes, large units of code, and even smaller ones, may be a chore to > figure out. Arguably harder when you use indentation and the next/last > parts are not even on the same scr

RE: ANN: Dogelog Runtime, Prolog to the Moon (2021)

2021-09-16 Thread Avi Gross via Python-list
Some questions make no sense to me. Can a kind of snake solve Sudoku? Do you mean a specific puzzle, or any puzzle or even a puzzle with no solution? Can a programming language do it? Well, in my experience, programming languages are tools to be used by humans, or sometimes by other programming

RE: Question again

2021-09-16 Thread Avi Gross via Python-list
Alan, I wonder if this is yet another case when a pop-up window closes rapidly when done and any last text written is just not perceived. Good design in such cases makes a final pause till the user acknowledges in some way that they are done and then no more messages! Avi -Original Message-

RE: XML Considered Harmful

2021-09-23 Thread Avi Gross via Python-list
Can we agree that there are way more general ways to store data than anything currently in common use and that in some ways, CSV and cousins like TSV are a subset of the others in a sense? There are trees and arbitrary graphs and many complex data structures often encountered while a program is run

RE: XML Considered Harmful

2021-09-23 Thread Avi Gross via Python-list
more like that? -Original Message- From: Python-list On Behalf Of Stefan Ram Sent: Thursday, September 23, 2021 5:43 PM To: python-list@python.org Subject: Re: XML Considered Harmful "Avi Gross" writes: >But scientific papers seemingly allow oodles of authors and any time

RE: XML Considered Harmful

2021-09-25 Thread Avi Gross via Python-list
Michael, I don't care what you choose. Whatever works is fine for an internal use. But is the data scheme you share representative of your actual application? >From what I see below, unless the number of "point" variables is not always exactly four, the application might be handled well by any f

RE: XML Considered Harmful

2021-09-27 Thread Avi Gross via Python-list
Monday, September 27, 2021 11:40 AM To: python-list@python.org Subject: Re: XML Considered Harmful On 25/09/2021 16.39, Avi Gross wrote: > Michael, > > I don't care what you choose. Whatever works is fine for an internal use. Maybe I should have taken the provoking article with a few

RE: XML Considered Harmful

2021-09-28 Thread Avi Gross via Python-list
ike you do want something easier to create while editing. -Original Message- From: Python-list On Behalf Of Michael F. Stemper Sent: Tuesday, September 28, 2021 11:38 AM To: python-list@python.org Subject: Re: XML Considered Harmful On 27/09/2021 20.01, Avi Gross wrote: > Michae

RE: XML Considered Harmful

2021-09-28 Thread Avi Gross via Python-list
400, Avi Gross via Python-list wrote: >> You keep talking about generators, though. If the generators are >> outside of your program, then yes, you need to read in whatever they produce. > > As I understood it, the "generators" don't generate the data, they are >

RE: XML Considered Harmful

2021-09-28 Thread Avi Gross via Python-list
we worked on what Hypertext should look like, ... -Original Message- From: Python-list On Behalf Of Michael F. Stemper Sent: Tuesday, September 28, 2021 2:41 PM To: python-list@python.org Subject: Re: XML Considered Harmful On 28/09/2021 13.27, Avi Gross wrote: > Well, Michael, if

RE: XML Considered Harmful

2021-09-29 Thread Avi Gross via Python-list
I think that to make electricity comprehend, you need a room temperature superconductor. The Cooper Pairs took a while to comprehend but now ... I think, seriously, we have established the problems with guessing that others are using the language in a way we assume. So how many comprehensions do

RE: How to pass a method as argument?

2021-09-30 Thread Avi Gross via Python-list
Sounds like an excellent homework question. But your method of using an object is not what first comes to mind based on your cursory description. There is a python idiom using functional programming that looks like this: def doit(a, b, fun): return(fun(a,b)) So make up your own function

RE: Understanding the working mechanis of python unary arithmetic operators.

2021-10-05 Thread Avi Gross via Python-list
Dave, Just one point. many things are allowed by a language even if normal people would NOT have any reason to do it NOR should use it. Although when used in one context + and - can be considered unary operators, the evaluation may result in successive unary operations being done one after anoth

RE: Re: sum() vs. loop

2021-10-12 Thread Avi Gross via Python-list
Alan, I am also wondering about that zip() function call to bind the two lists into a sort of iterator object. Presumably that calls the iterator N times. I did a test where I made two list called A and B and used zip to make an object holding the two and then removed A and B. I was able to print

RE: sum() vs. loop

2021-10-13 Thread Avi Gross via Python-list
worry the original might be changed out from under. My apologies if it was understood to mean I had shown it was copied. -Original Message- From: Python-list On Behalf Of Stefan Ram Sent: Tuesday, October 12, 2021 9:49 PM To: python-list@python.org Subject: Re: sum() vs. loop &quo

RE: New assignmens ...

2021-10-24 Thread Avi Gross via Python-list
No, many things need not be as general as possible once you consider how much work it may take to develop code and how many bugs and oddities might be introduced and even how much it may slow the interpreter. I could make an argument that everywhere you can put in a character string should also al

RE: New assignmens ...

2021-10-25 Thread Avi Gross via Python-list
paste operation for the more complex scenarios even if they remember the fancy version exists and is bound to some forgotten series of keys clicked together like control-X control-alt-t or something. -Original Message- From: Python-list On Behalf Of Antoon Pardon Sent: Monday, October 2

RE: New assignmens ...

2021-10-25 Thread Avi Gross via Python-list
We have had discussions debating if Python is a good language for teaching. The short answer is NO unless you only teach a small subset and the students know there is more they can learn as needed. The language is too rich and has too many ways to do seemingly anything and that is before you add mo

RE: Beginner in python

2021-10-25 Thread Avi Gross via Python-list
Chris, I was just about to suggest: 1+3+5+7+9 and 50*101 but that would mean helping with what does seem like fairly simple homework with no effort to show us what they already tried and got stuck with! So, ignore my attempts at trivial humor as I suspect some form of loop was anticipated.

RE: New assignmens ...

2021-10-25 Thread Avi Gross via Python-list
n-list On Behalf Of Stefan Ram Sent: Monday, October 25, 2021 12:57 PM To: python-list@python.org Subject: Re: New assignmens ... "Avi Gross" writes: >Now, yes, nobody needs a function to just add two numbers. If one uses a framework like "functools.reduce", the only way

RE: Create a contact book

2021-10-26 Thread Avi Gross via Python-list
Chris, I think it is time someone set up a business where they do the homework for people for a mere $1,000 or so per hour. Anonymously, of course. And we can refer requests for free homework advice there. Maybe the answer to this request is to suggest they use FACEBOOK which seemingly keeps you

RE: New assignmens ...

2021-10-27 Thread Avi Gross via Python-list
I think anyone who suggests we should separate costs from benefits belongs securely within the academic world and should remain there. Practical things need to be built considering costs. Theoretical things, sure, cost is not an issue. Python is not only a real-world set of applications but an ev

RE: Create a contact book

2021-10-27 Thread Avi Gross via Python-list
normally have enough local help. -Original Message- From: Python-list On Behalf Of dn via Python-list Sent: Wednesday, October 27, 2021 12:15 AM To: python-list@python.org Subject: Re: Create a contact book On 27/10/2021 04.16, Avi Gross via Python-list wrote: > Chris, > > I thin

RE: New assignmens ...

2021-10-27 Thread Avi Gross via Python-list
Dave, You make me wonder about unintended side effects. Are we allowing the ++ and --- operations into Python through a side door? any context that allows you to insert the walrus operator like: index := index + 1 index := index - 1 Is now similar to notations in C/C++ and other

walrus with a twist :+= or ...

2021-10-27 Thread Avi Gross via Python-list
I realized that the person seeking completeness in Python may next ask why the Walrus operator, :=, is not properly extended to include a whole assortment of allowed assignment operators I mean in normal python programs you are allowed to abbreviate x = x + 5 with x += 5 Similar

RE: walrus with a twist :+= or ...

2021-10-27 Thread Avi Gross via Python-list
I just realized I left out **= so my apologies. Are there other such abbreviations and does anyone use them? -Original Message- From: Python-list On Behalf Of Avi Gross via Python-list Sent: Wednesday, October 27, 2021 8:57 PM To: python-list@python.org Subject: walrus with a twist

RE: walrus with a twist :+= or ...

2021-10-27 Thread Avi Gross via Python-list
Wednesday, October 27, 2021 9:11 PM To: Python Subject: Re: walrus with a twist :+= or ... On Thu, Oct 28, 2021 at 11:58 AM Avi Gross via Python-list wrote: > On a serious note, if it was ever considered a good idea, what would > be an acceptable sequence of symbols that might not b

RE: walrus with a twist :+= or ...

2021-10-27 Thread Avi Gross via Python-list
we got along fine before a walrus came along, ... or did we? -Original Message- From: Python-list On Behalf Of MRAB Sent: Wednesday, October 27, 2021 9:21 PM To: python-list@python.org Subject: Re: walrus with a twist :+= or ... On 2021-10-28 02:06, Avi Gross via Python-list wrote: >

RE: Re: The task is to invent names for things

2021-10-28 Thread Avi Gross via Python-list
Names can be taken too far as the same variable may have different connotations in one place than another. Say I am counting how many of something and incrementing variable HowMany as I go along and initialized to zero. Then I want to test if I have any and instead of: if (HowMany > 0) I

RE: New assignmens ...

2021-10-28 Thread Avi Gross via Python-list
, 5+cos(x))) … Not necessarily pretty and I am sure there may well be reasons it won’t work, but I wonder if it will work in more places than the currently minimal walrus operator. From: Antoon Pardon Sent: Thursday, October 28, 2021 3:03 AM To: Avi Gross ; python-list@python.org Subj

RE: walrus with a twist :+= or ...

2021-10-28 Thread Avi Gross via Python-list
ything like I am describing (or something much better) is being looked at? -Original Message- From: Python-list On Behalf Of Peter J. Holzer Sent: Thursday, October 28, 2021 5:08 AM To: python-list@python.org Subject: Re: walrus with a twist :+= or ... On 2021-10-27 22:15:09 -0400, Avi

RE: The task is to invent names for things

2021-10-28 Thread Avi Gross via Python-list
t names for things Supersedes: [corrected two typos] "Avi Gross" writes: >if (WeHaveAny) |Function names should be lowercase, with words separated by underscores |as necessary to improve readability. |Variable names follow the same convention as function names. PEP 8 (2019) The n

RE: walrus with a twist :+= or ...

2021-10-28 Thread Avi Gross via Python-list
, that should do even on standard keyboards. ∴ -Original Message- From: Python-list On Behalf Of Chris Angelico Sent: Thursday, October 28, 2021 3:24 PM To: Python Subject: Re: walrus with a twist :+= or ... On Fri, Oct 29, 2021 at 5:53 AM Avi Gross via Python-list wrote: > Is ther

RE: New assignmens ...

2021-10-29 Thread Avi Gross via Python-list
29, 2021 10:04 AM To: python-list@python.org Subject: Re: New assignmens ... Op 28/10/2021 om 19:36 schreef Avi Gross via Python-list: > Now for a dumb question. Many languages allow a form of setting a variable to > a value like: > > > > assign(var, 5+sin(x))

RE: How to apply a self defined function in Pandas

2021-10-31 Thread Avi Gross via Python-list
When people post multiple comments and partial answers and the reply every time is to ask for more; there may be a disconnect. Some assume that the person is just stuck but generally can go forward with a little hint. But when you keep being asked for more, maybe it means they want you to do it

RE: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-20 Thread Avi Gross via Python-list
This discussion gets tiresome for some. Mathematics is a pristine world that is NOT the real world. It handles near-infinities fairly gracefully but many things in the real world break down because our reality is not infinitely divisible and some parts are neither contiguous nor fixed but in some

RE: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-20 Thread Avi Gross via Python-list
n floats but on the design not accommodating the precision needed or perhaps on the algorithm used not necessarily being expected to reach a certain level. -Original Message- From: Python-list On Behalf Of Chris Angelico Sent: Saturday, November 20, 2021 5:17 PM To: python-list@python.or

RE: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-20 Thread Avi Gross via Python-list
Can I suggest a way to look at it, Grant? In base 10, we represent all numbers as the (possibly infinite) sum of ten raised to some integral power. 123 is 3 times 1 (ten to the zero power) plus 2 times 10 (ten to the one power) plus 1 times 100 (ten to the two power) 123.456 just extends this wi

RE: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-20 Thread Avi Gross via Python-list
not expected to apply for a non-abelian case. -Original Message- From: Python-list On Behalf Of Rob Cliffe via Python-list Sent: Saturday, November 20, 2021 6:19 PM To: Subject: Re: Unexpected behaviour of math.floor, round and int functions (rounding) On 20/11/2021 22:59, Avi Gross

RE: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-20 Thread Avi Gross via Python-list
om: Python-list On Behalf Of Chris Angelico Sent: Saturday, November 20, 2021 6:23 PM To: python-list@python.org Subject: Re: Unexpected behaviour of math.floor, round and int functions (rounding) On Sun, Nov 21, 2021 at 10:01 AM Avi Gross via Python-list wrote: > Computers generally

RE: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-20 Thread Avi Gross via Python-list
- From: Python-list On Behalf Of Chris Angelico Sent: Saturday, November 20, 2021 8:03 PM To: python-list@python.org Subject: Re: Unexpected behaviour of math.floor, round and int functions (rounding) On Sun, Nov 21, 2021 at 11:39 AM Avi Gross via Python-list wrote: > > Can I suggest a

RE: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Avi Gross via Python-list
I am not sure what your real problem is, Ulli, but many antivirus programs can be TEMPORARILY shut off. Not highly recommended, of course, but if you properly disable it on a newly rebooted system running little, and it still happens, then something else may be going on. If one recognizes your cod

RE: recover pickled data: pickle data was truncated

2021-12-29 Thread Avi Gross via Python-list
I am not an expert on the topic but my first reaction is it depends on how the data is corrupted and we do not know that. So I am addressing a more general concept here. Some algorithms break if a single byte or even bit changes and nothing beyond that point makes sense. Many encryption techniques

RE: builtins.TypeError: catching classes that do not inherit from BaseException is not allowed

2021-12-30 Thread Avi Gross via Python-list
Beauty of Recursion? Well, there is what I call Mathematical Beauty, and then there is reality. It is fantastic to prove neat theorems that something is possible by methods like mathematical induction that in some sense use recursion as in if something is true for some base value and it can be sh

RE: builtins.TypeError: catching classes that do not inherit from BaseException is not allowed

2021-12-31 Thread Avi Gross via Python-list
I am sure some people have a sense of humor, but anyone on this forum who actually does not have some idea of what various "tree" data structures are in computer science, probably won't get any replies from me when asking such questions. But indeed there are things closer to classical trees that a

Re: What to write or search on github to get the code for what is written below:

2022-01-07 Thread Avi Gross via Python-list
This entire thread seems a bit IFFY to me. It does seme like HW to me but also a bit peripheral. The fact that the data is in EXCEL is a detail. And unless a spreadheet is complex, it may be trivial to save the file as a .CSV and from then on read from there into Python (or anything) and when don

Re: Extracting dataframe column with multiple conditions on row values

2022-01-08 Thread Avi Gross via Python-list
I have to wonder if when something looks like HOMEWORK, if it should be answered in detail, let alone using methods beyond what is expected in class. The goal of this particular project seems to be to find one (or perhaps more) columns in some data structure like a dataframe that match two condi

Re: What to write or search on github to get the code for what is written below:

2022-01-09 Thread Avi Gross via Python-list
Is this thread even close to being on track? It is not really relevant to argue yet on whether to use EXCEL directly or a data.base. Many ways can be used to solve a problem and if the EXCEL sheet will never be updated manually or by some other program, it is sort of moot as you can ONE TIME tra

Re: What to write or search on github to get the code for what is written below:

2022-01-13 Thread Avi Gross via Python-list
I am not replying to anything below so I have removed it. So I need to remind people of the topic and how it has wandered. Someone has data in a not particularly great format in an EXCEL spreadsheet. They want to somehow use an external language like Python to manipulate the contents from outsid

Re: What to write or search on github to get the code for what is written below:

2022-01-15 Thread Avi Gross via Python-list
To: python-list@python.org Sent: Sat, Jan 15, 2022 3:05 pm Subject: Re: What to write or search on github to get the code for what is written below: On 1/13/22 16:08, Avi Gross via Python-list wrote: > > I am not replying to anything below so I have removed it. > Instead, someone sug

Re: Writing a string with comma in one column of CSV file

2022-01-15 Thread Avi Gross via Python-list
Mahmood, Ask yourself WHY you want to do what you are doing. Are you using the power and features of the language or trying to do it step by step in the way that earlier languages often made you do it? Yes, there are ways to include commas in fields of a CSV file and they can lead to complicatio

Re: What to write or search on github to get the code for what is written below:

2022-01-17 Thread Avi Gross via Python-list
working set of software first. Good luck with that.  -Original Message- From: NArshad To: python-list@python.org Sent: Mon, Jan 17, 2022 4:55 am Subject: Re: What to write or search on github to get the code for what is written below: Avi Gross: -“They just were hoping someone would post

Re: What to write or search on github to get the code for what is written below:

2022-01-18 Thread Avi Gross via Python-list
2022 2:44 pm Subject: Re: What to write or search on github to get the code for what is written below: On Tue, 18 Jan 2022 07:37:07 -0800 (PST), NArshad declaimed the following: >Avi Gross: >     Not Avi Gross, but that is partly because you replied to Chris Angelico, who was replying to

Re: What to write or search on github to get the code for what is written below:

2022-01-22 Thread Avi Gross via Python-list
I keep wondering about the questions asked by NArshad here. His message can be read below mine, for context. This is a place focused on using the Python language. The web page being in HTML is beyond irrelevant and in particular, web pages generally are in HTML even if only as a way to call oth

Re: Pandas or Numpy

2022-01-23 Thread Avi Gross via Python-list
Definitely it sounds like you may use both. Quite a bit of what people do using DataFrame objects includes working on copies of individual columns, which often are numpy Series or the like and in the other direction, can be used to create or amend a pandas DataFrame. Plus, many operations used t

Re: Data unchanged when passing data to Python in multiprocessing shared memory

2022-02-02 Thread Avi Gross via Python-list
I applaud trying to find the right solution but wonder if a more trivial solution is even being considered. It ignores big and little endians and just converts your data into another form and back. If all you want to do is send an integer that fit in 32 bits or 64 bits, why not convert it to a

Re: Data unchanged when passing data to Python in multiprocessing shared memory

2022-02-02 Thread Avi Gross via Python-list
aside and the string use a null terminator if shorter. Of course if this big-endian issue also scrambles bytes used in strings, forget it. Or, maybe shared memory is not the easy way to go, even it it might be faster. -Original Message- From: Jen Kris To: Avi Gross Cc: python-list

Re: Waht do you think about my repeated_timer class

2022-02-04 Thread Avi Gross via Python-list
time_after_time But to be more pythonic, throw some double underscores before and after. -Original Message- From: Igor Berger To: python-list@python.org Sent: Fri, Feb 4, 2022 12:40 pm Subject: Re: Waht do you think about my repeated_timer class On Friday, February 4, 2022 at 12:28:53 PM

Re: Kind Remainder: How do Practitioners Approach towards Requirements Engineering?

2022-02-08 Thread Avi Gross via Python-list
Is there any way to get this mesage to stop showing up in my mailbox in what seems to be a shotgun approach asking everybody everywhere they can think of to participate in something very amorphous and at the same time having NOTHING particular to do with Python? I consider things like this SPAM

Re: Best way to check if there is internet?

2022-02-09 Thread Avi Gross via Python-list
Actually, you may want a dynamic page. Pages may sometimes be delivered from some cache along the way perhaps within your own company firewall if someone else recently accessed them. Consider a page that returns the current time or like the following asks for an arithmetical calculation to add 5

Re: How to solve the given problem?

2022-02-10 Thread Avi Gross via Python-list
Anyone think someone keeps asking homework questions? This seems absolutely unrelated to earlier discussions from this person. Jobs often tend to remain focused. I opt out after frustration with earlier exchanges with NArshad about library books and EXCEL ... -Original Message- From: N

Re: Long running process - how to speed up?

2022-02-19 Thread Avi Gross via Python-list
Indeed not a clear request. Timing is everything but there are times ... For many purposes, people may read in the entire CSV at a gulp into some data structure like a pandas DataFrame. The file is then closed and any processing done later does whatever you want. Of course you can easily read on

Re: Why does not Python accept functions with no names?

2022-02-20 Thread Avi Gross via Python-list
Not really. Anonymous functions are anonymous in name only, so to speak. When you call a function and pass it an argument that is an anonymous function definition, it is bound to a variable within the function and used mostly in a non-anonymous way. You did not bother giving it a name but it is r

Re: Long running process - how to speed up?

2022-02-20 Thread Avi Gross via Python-list
dAVId, I would like to assume that the processing needed is quite a bit more than calculating the square of each X. But as we are getting negligible information on anything useful, why continue interacting.  I am trying to imagin a scenario with a million rows of sorts in a CSV (typically not us

Re: Why does not Python accept functions with no names?

2022-02-20 Thread Avi Gross via Python-list
Amusingly, Greg, if you had a system where the un-named anonymous function was to be named the unique value of the empty string, then a second such anonymous function definition would over-write it, as with any named function. The kind of anonymous function we are more used to might be something

Re: Why does not Python accept functions with no names?

2022-02-21 Thread Avi Gross via Python-list
Eric, You bring up a related topic which I agree with. You need to be careful to make aspects of a language as consistent as possible and thus allowing no receiver of a function definition (somewhat different than no name) might result in anomalies in other parts of the language. Errors that cou

Re: One-liner to merge lists?

2022-02-22 Thread Avi Gross via Python-list
Frank, Given this kind of data: d = {1: ['aaa', 'bbb', 'ccc'], 2: ['fff', 'ggg']} You seem focused on a one-liner, however ridiculous or inefficient. Does this count as a somewhat weird one liner? comb = []; _ = [comb.append(v) for v in d.values()] If you run the code and ignore the returned

Re: Best way to check if there is internet?

2022-02-22 Thread Avi Gross via Python-list
As usual, his discussion is wandering a bit. Yes, some things are not reliable but sometimes a heuristic answer is better than none. Internet connections are beyond flaky and worse the connection you want may be blocked for many reasons even if other connections you try are working. Any number

Re: One-liner to merge lists?

2022-02-22 Thread Avi Gross via Python-list
I had to think about it too, David. Renaming it lets it make a bit more sense: [item for sublist in d.values() for item in sublist] This spells it out for me that you are taking one list within the main list at a time and then taking one item at a time from the list. Since the nesting is consi

<    1   2   3   4   5   >