This does raise an issue, Chris, if you use the method of making a tuple
companion for a list at a specific time just for use as a dictionary key, then
later change the list, you can end up with various situations.
Obviously the changed list can not only not access the stored item, but if
conver
Python does have a concept of "truthy" that includes meaning for not just the
standard Booleans but for 0 and non-zero and the empty string and many more odd
things such as an object that defines __bool__ ().
But saying it returns a Boolean True/False valuesounds direct and simple and
informativ
We know some people using "professional" language make things shorteror talk
from a point of view different than others and often in otherwise
incomprehensible jargon.
If a programmer is taking about the algorithm that a function implements, then,
yes, they may write "scan" and "return".
But if
Given what you added, Michael, your function is part of a larger collection of
functions and being compatible with the others is a valid consideration.
Whatever you decide, would ideally be done consistently with all or most of
them.
And, of course, it others in the collection also can handle mu
I have been getting confused by how many interpretations and conditions for
chasing tail people seem to be talking about.
A fairly normal task is to want to see just the last N lines of a text-based
file.
A variant is the "tail -f" command from UNIX that continues to follow a growing
file, ofte
Yes, Michael, a dictionary is an excellent way to represent a closed set of
transitions which your permutations are.
You examples use numerals but obviously a dictionary will allow transformations
of anything that can be hashed which mostly is items that are not mutable.
Of course for the purpose
https://wiki.python.org/moin/PythonBooks
-Original Message-
From: Patrick 0511
To: python-list@python.org
Sent: Wed, May 4, 2022 9:36 pm
Subject: Python/New/Learn
Hello, I'm completely new here and don't know anything about python. Can
someone tell me how best to start? So what things
-list@python.org
Sent: Wed, May 4, 2022 11:02 pm
Subject: Re: Python/New/Learn
On Thu, 5 May 2022 at 12:57, Avi Gross via Python-list
wrote:
>
> https://wiki.python.org/moin/PythonBooks
>
That's an incredibly daunting list, and not something I'd overly
strongly recommend, but yes, i
I agree Chris that the Ukrainian Python Books are daunting as I barely started
learning that language now even though my early years were just a few miles
away and I might even have relatives still there!
But as has been pointed out, suggestions are more helpful if you know a bit
more about the
Before more people reply to this user, I note I have not seen them reply back
to the list about any questions or comments others have taken the time to
provide.
My warning bells go off when I see patterns and there was a similar request
from another gmail account to an R language forum I am als
This topic has rapidly shifted over way beyond Python even as the original
person has not returned to participate.
There are many ways to teach anything and since the classical method was to
learn in person from someone using mainly sound or pantomime, it has hung on.
Even with the existence of
Marco,
I think it was made clear from the start that "text" files in the classic sense
have no random access method at any higher level than reading a byte at some
offset from the beginning of the file, or back from the end when it has not
grown.
The obvious fact is that most of the time the li
Just FYI, UNIX had a bunch of utilities that could emulate a vanilla version of
tail on a command line.
You can use sed, awk and quite a few others to simply show line N to the end of
a file or other variations.
Of course the way many things were done back then had less focus on efficiency
than
This seems to be a regular refrain where someone wants something as STANDARD in
a programming language or environment and others want to keep it lean and mean
or do not see THIS suggestion as particularly important or useful.
Looking at the end of something is extremely common. Packages like nump
Bryan,
As has been pointed out, it is very common in possibly all programming
languages to not allow digits at the start of many identifiers. It makes it
hard to parse for numbers which tend to start with digits. Some languages even
have special rules on not starting a number with a zero unless
... ❽ ❽
-Original Message-----
From: Avi Gross via Python-list
To: python-list@python.org
Sent: Fri, May 13, 2022 6:02 pm
Subject: Re: .0 in name
Bryan,
As has been pointed out, it is very common in possibly all programming
languages to not allow digits at the start of many identifiers. It
You left out 3CPO, Dave.
Names with numerals are not unreasonable in some circumstances.
But programming languages are not a full spectrum of real life. They can have
reserved words too so you may not be able to use "while" and if you choose to
create a function that masks another, you cannot c
invest_crypto.client_list.append(self)
I am wondering about the phrasing above.
When you are in the dunder init function, you normally create and change items
in YOURSELF so why is your code not changing self.crypto_client_list?
And what are you appending to before ever creating it? Would it k
Amazing how some people bring out the heavy artillery, first! LOL!
If the question was how to remove any initial digits and perhaps whitespace in
a string, it is fairly easy to do without any functions to test if there are
digits before the title. I mean look at initial characters and move forwa
Dave,
Your goal is to compare titles and there can be endless replacements needed if
you allow the text to contain anything but ASCII.
Have you considered stripping out things instead? I mean remove lots of stuff
that is not ASCII in the first place and perhaps also remove lots of extra
punctu
Dave,
Sometimes a task is done faster by NOT programming anything in any language!
Not only have you spent a lot of your own time but many dozens of messages here
have dragged in others, who gain nothing ;-)
The domain you are operating in seems to have lots of variants in how the
titles are s
Dave,
Despite your other programming knowledge, I suspect you think this is the forum
where people come to be tutored. Try here:
https://mail.python.org/mailman/listinfo/tutor
Yes, there are plenty of pretty printers available and you can build your own
function fairly easily. A module like pp
I wish this discussion was simplified.
It sounds to me like what is wanted is a way to PRINT a filled-out form using
some dynamic text that fits over designated slots in the data. It is not that
different from many other tasks where you overlay some graphics with text.
You need a decent version o
This leads to the extremely important question of what would an implementation
of Python, written completely in C++, be called?
C++Python
CPython++
C+Python+
DPython
SeaPython?
SeeSeaSiPython
I don't even want to think fo what sound a C# Python would make.
OK, my apologies to all. Being an inter
If we want to be humorous, RPython would obviously either be written in R,
which really is not designed well for such purposes, or would be some kind of
synthesis that already exists that allows you to run R and python code
interchangeably on sort of shared data that I sometimes do in RSTUDIO.
David,
I am curious why you are undertaking the effort to take a language already
decades old and showing signs of being a tad rusty into a language that
suggests further oxidation.
More seriously, I am interested in what this can gain and the intended user
base. I studied Rust for a while and i
David,
I understand now. As a project for your own edification I can understand it,
albeit it is a more substantial effort than many people might choose, LOL!
So unless it starts being used heavily and adopted by some organization, the
result of your effort will not necessarily be compatible with
Nati Stern has asked several questions here, often about relatively technical
uses of python code that many of us have never used and still is not providing
more exact info that tends to be needed before anyone can even think of
diagnosing the problem.
I have learned to stay away from some such
Nati,
This is a two-way process and requires you to be very clear on what is not
working or what you are trying to do or help clear away having us try to
understand lots of code that is not very related to the question.
Your code, as shown, makes an empty string repeatedly in a loop.
a=dict()
I
I think it is time to ask this topic to go find some other place to talk to
itself.
I have seen NO reason to think any question about problems with Python has been
asked. Not properly.
It sounds like someone messed up an installation, perhaps of other programs
like an editor and some unspeci
Timing things that are fairly simple is hard enough to do repeatedly, but when
it involves access to slower media and especially to network connections to
servers, the number of things that can change are enormous. There are all kinds
of caching at various levels depending on your hardware and r
Bongo,
Variables in most programming languages either have to be removed manually
or allowed to drift outside a boundary when they disappear for scoping
reasons and perhaps are garbage collected at some point.
There are many ways to make transient variables that disappear at some time
and do we
I still see no great reason for a new feature here and the namespace issue has
often been discussed. You can always opt to create your own namespace of some
sort and make many of your variables within it and always refer to the
variables explicitly so the only collisions that can happen are your
Whoa!
The question cannot be about whether it is possible to prove any abstract
program will be correct and especially not on real hardware that can fail in
various ways or have unexpected race conditions or interacts with other places
such as over the internet.
It has been quite well proven (
, 2023 9:41 PM
To: python-list@python.org
Subject: Re: Question(s)
On Wed, 25 Oct 2023 at 12:20, AVI GROSS via Python-list
wrote:
> Consider an example of bit rot. I mean what if your CPU or hard disk has a
location where you can write a byte and read it back multiple times and
sometimes get the wr
org
Subject: Re: Question(s)
On Tue, Oct 24, 2023 at 9:36 PM AVI GROSS via Python-list
wrote:
>
> Agreed, Chris. There are many methods way better than the sort of RAID
> architecture I supplied as AN EXAMPLE easy to understand. But even so, if a
> hard disk or memory chip is fried or a nuclear
Just want to add that even when you can prove that an algorithm works
absolutely positively, it will often fail on our every finite computers.
Consider families of algorithms that do hill climbing to find a minimum and
maximum and are guaranteed to get ever closer to a solution given infinite
t
I am not one for IDLE worship, Tenor. But if you have been getting a message
here, it is that there are an amazing number of programs that support your use
of python during the development phase and perhaps later. I actually often use
an environment called RSTUDIO (now part of a new name of POSI
: Thursday, October 26, 2023 6:50 PM
To: python-list@python.org
Subject: Re: Question(s)
On 10/26/2023 6:36 PM, AVI GROSS via Python-list wrote:
> I am not one for IDLE worship, Tenor. But if you have been getting a
message here, it is that there are an amazing number of programs that
support your
Yes, it would be nice if there was a syntax for sending a test message sort
of like an ACK that is not delivered to the recipient but merely results in
some status being sent back such as DELIVERABLE or NO SUCH USER or even
MAILBOX FULL.
An issue with the discussion that may be worth considering i
via Python-list
Sent: Thursday, November 2, 2023 2:05 AM
To: python-list@python.org
Subject: Re: Checking if email is valid
On Thu, 2 Nov 2023 at 15:20, AVI GROSS via Python-list
wrote:
>
> Yes, it would be nice if there was a syntax for sending a test message
sort
> of like an ACK th
I have never had a need to check email but in my reading over the years, I am
aware of modules of multiple kinds you can use to do things like parsing dates,
URL and email addresses and probably many other such things into some kind of
object and then you can use aspects of the object to do inte
E bad addresses.
-Original Message-
From: Python-list On
Behalf Of Chris Angelico via Python-list
Sent: Friday, November 3, 2023 1:43 AM
To: python-list@python.org
Subject: Re: Checking if email is valid
On Fri, 3 Nov 2023 at 12:21, AVI GROSS via Python-list
wrote:
> My guess is that a fi
Grant (and others),
I am asking about the overall programming process of dealing with email
addresses beyond checking the string for some validity.
You mentioned requiring you type in your email twice as one example. I
generally do a copy/paste to avoid typing or have my browser fill it in.
Rarel
Just mildly noticing the topics discussed have wandered quite a bit away
from Python, let alone even programming.
Phone numbers are not what they used to be. They tend to be quite portable
and in some ways can be chained so my house phone rings through to my cell
phone but a text will not be forwa
Discussions like this feel a bit silly after a while. How long something is
to type on a command line is not a major issue and brevity can lead to being
hard to remember too especially using obscure references.
Consider that the Perl version as shown below does not need to import
anything. If yo
Text messages have taken a nasty turn and especially now that so many people
have unlimited messages per month in their plan. People overuse them to the
point where I opt out of some things like my home town notifications as they
bombard me with other things I am not interested in.
A major offende
I was going to ask a dumb question. Has any other language you know of made
something available that does what is being asked for and included it in the
main program environment rather than an add-on?
A secondary mention here has been whether short-circuiting functions like
"any" and "all" have be
’t require predicates.
b) I welcome any thoughts on this.
DG
> On 14 Nov 2023, at 04:27, AVI GROSS via Python-list
> wrote:
>
> I was going to ask a dumb question. Has any other language you know of made
> something available that does what is being asked for and included it in the
&
Many features like regular expressions can be mini languages that are designed
to be very powerful while also a tad cryptic to anyone not familiar.
But consider an alternative in some languages that may use some complex set of
nested function calls that each have names like match_white_space(2,
Grizz[l]y,
I think the point is not about a sorted list or sorting in general It is
about reasons why maintaining a data structure such as a list in a program
can be useful beyond printing things once. There are many possible examples
such as having a list of lists containing a record where the th
That is an entirely different discussion, Michael.
I do not know what ideas Guido had ages ago and where he might stand now and
I actually seriously disagree with the snippet you quoted below.
Python was started long ago as a way to improve in some ways on what was
there before. Some of the ide
Just FYI, I deliberately chose that abbreviation for a sort of irony as for
some people college is about almost anything except learning and some people
think they are studs and just party and ...
And I am very tired of gender discussions. Lots of words now include two or
even more genders. Women
Isn't it fascinating that a meaningless piece of code used to illustrate
something can be analyzed as if it was full of malicious content?
Yes, my choice of names was as expected. The numbers chosen had no special
meaning other than choosing one number in each of three equivalence classes.
But, i
Dave,
Back on a hopefully more serious note, I want to make a bit of an analogy
with what happens when you save data in a format like a .CSV file.
Often you have a choice of including a header line giving names to the
resulting columns, or not.
If you read in the data to some structure, often to
Dave, I gave an example, again, and make no deep claims so your comments may be
valid, without any argument.
I mentioned CSV and a related family such as TSV as they were a common and
simple data format that has long been used. There are oodles of others and yes,
these days many people can read
Ethan, if it is not obvious, then should we add the following functions just
in case?
cube_root()
fourth_root()
nth(root)
two_thirds_root()
e_th_root()
pi_th_root()
x_ove
I am wondering how hard it would be to let some generators be resettable?
I mean if you have a generator with initial conditions that change as it
progresses, could it cache away those initial conditions and upon some
signal, simply reset them? Objects of many kinds can be set up with say a
reinit
I may be the only one who does not deal well with a condescending attitude.
I have to wonder what international standards body ever completes a task in
finite time, only to find the real world has moved on. Having standards can be
a great idea. When the standard does not properly describe any im
I agree both with the idea that it is not good to mutate things during
iteration and that some things we want to do may seemingly require
effectively something like a mutation.
I want to consider what data structure might capture a normal activity like
having a to-do-list for TODAY and another for
It is likely that people would understand better if spoken to properly so I
have been listening and hopefully gaining a picture that I can share, and be
corrected helpfully when wrong.
My personal guess is that the project at hand is to do something very vaguely
like what was done to the CURSES
I think we have discussed this a few times. There are tradeoffs in computer
science and obviously a compiled language with some optimization using
low-level data structures does much better at solving simple problems.
Interpreted languages often have serious overhead to start with and allow all
Grant,
Haven't thought about Prolog in a LOOONG time but it had some wild twists on
how to specify a problem that might not be trivial to integrate with other
languages as our now seemingly censored person with much delusion of
grandeur suggests. It is a language that does not specify what to do b
Christian,
Thanks for sharing. I took a look and he does have a few schemas for Ada and
C from TWO YEARS ago. Nothing about the infinite number of other languages
he plans on supporting, let alone Python. And what he has is likely not
enough to do what he claims he can do easily and rapidly.
What
I wonder if someone has come up with a sort of Python environment that lets
kids play with more fundamental parts of the language that lets them get
educated without the confusion. I mean a limited subset and with some
additions/modifications.
Someone mentioned how something like range(1,10) is
Dennis made the interesting comment "... Python has too much built in ..."
I understand his point. At the same time, I wonder what most people using
computers today, or in the future, need. Given serious amounts of computer
power, what many people may want is higher-level ways to get things done
w
Some of us here go way back and have stories to tell of what we did even
before Python existed. I won't rehash my history here now except to say I
did use PASCAL in graduate school and my first job before switching to C
which was less annoying to use.
What I am interested in, in this forum, is how
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
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
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
, 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
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
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
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
As a guess, Rob, precedence rules for not may not bind as strongly as you think.
1 + (not 1)
With parentheses, "not 1" is a subexpression that should be performed first and
might return the value "False"
1 + False
treats False in a numeric context as a zero so evaluates to 1.
But
1 + not 1
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
"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
I apologize for my earlier snide remark as I was not then aware there was an
algorithm called apriori based on the Latin term and wondered if someone was
pulling someone's leg, in advance.
Someone has posted a pointer to Python code that is supposed to do that. If
that is suitable, then the seriou
The precedence example used below made a strange assumption that the
imaginary program would not be told up-front what computer language it was
being asked to convert from. That is not the scenario being discussed as we
have described. In any particular language, there usually is a well-known
prece
Speaking for myself, that is a very significant piece of homework to do and
unless you do quite a bit and get stuck and ask for help in some aspect,
this is not the place to ask if anyone wishes to do all the work.
The assignment seems to want you to write your own code to implement the
algorithm.
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
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
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
n-list On
Behalf Of Alan Gauld via Python-list
Sent: Wednesday, March 24, 2021 5:28 AM
To: python-list@python.org
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
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
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
plit!
∀vi ∃. Grθß
-Original Message-
From: Python-list On
Behalf Of 2qdxy4rzwzuui...@potatochowder.com
Sent: Friday, March 26, 2021 9:43 PM
To: python-list@python.org
Subject: Re: convert script awk in python
On 2021-03-26 at 21:06:19 -0400,
Avi Gross via Python-list wrote:
> A generat
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
Congratulations, Alan, on the book.
I continue to wonder if people will buy the book for the wrong reason or ban
it thinking you created an AI snake that creates and spews new CURSES never
heard before.
The good news is that for those interested you can click on the book image
and see the preview
Bill,
I went afterward to the US Amazon Site and the prices are in dollars and
ordered the paperback for $5.99, no shipping cost with PRIME but I ordered,
paradoxically, an assortment of mice alongside so it would have been free
anyway. The Kindle version is $1.49
https://www.amazon.com/Progra
Chris,
Now that it is April 2, I have to ask which of the methods for dealing with
chocolate is more pythonic and is there a module for that?
Next April, can we switch beans and discuss different grades of coffee and
which ones are best to shave at home with a potato peeler?
I think that would
Terry: ... '__missing__' is new since I learned Python ...
With so many new dunder variables added, I am wondering when some dunderhead
comes up with:
__mifflin__
The documented use paper is:
https://theoffice.fandom.com/wiki/Dunder_Mifflin_Paper_Company
-Original Message
https://translate.google.com/?sl=is&tl=en&op=translate
Or, you could do it the hard way.
Kidding aside, there may be a python module you can hand a file name or
contents to and have it do much of the job using some API that may tap into
the above Google resource.
Dan specifically suggested impor
Sidestepping the wording of "options" is the very real fact that providing
names for even required parts can be helpful in many cases.
There re programs that may not require anything on the command line to be
done but many need something to provide some flexibility.
So, I tend to agree that in ma
Yes, Python is a moving target, as are quite a few such things these days.
The changes when release 3 came along mean that what you find by a search
may not apply to your situation. And as new features get added, some advice
might shift. The presence of so many add-on modules also means that the
s
Chris,
Given some notice, what stops anyone from joining the mailing list before
there is a divorce between the forums?
Everybody has trivial access to an email account these days and many mailers
allow incoming messages that fit a pattern to be placed in some names folder
to be read as a group i
Chris,
I got the fastest python yesterday as it was so fast that it beat the one
coming tomorrow.
The trick is adding back the legs that evolution allowed to lapse.
Without bated breath,
Regardless,
Avi
-Original Message-
From: Python-list On
Behalf Of Chris Angelico
Sent: Wednesday,
Benjamin,
The topic is being changed by me because I get amused by statistics.
We can all agree that any form of energy use uses energy, duh! But that does
not make it good or bad in isolation.
If I had a job that had me wake up every day in the dark, drive for an hour to
an airport, hop acros
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
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
1 - 100 of 312 matches
Mail list logo