RE: Couldn't install numpy on Python 2.7

2024-06-12 Thread AVI GROSS via Python-list
Chris, You seem to have perceived an insult that I remain unaware of. I have no special knowledge, like you do, of plans made for changes to the pthon language and implementation. I was asking a hypothetical question about what some users would do if python came out with a newer major version

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread Chris Angelico via Python-list
s another incompatible change just around the corner. Do you realise how insulting you are being to the developers of Python by these implications? ChrisA -- https://mail.python.org/mailman/listinfo/python-list

RE: Couldn't install numpy on Python 2.7

2024-06-12 Thread AVI GROSS via Python-list
Chris, I don't want to get off message and debate whether my "jokes" are jokes, let alone funny. Obviously, they often aren't. What I meant by joking here does seem relevant. As the years pass, there can come a time when it is suggested that a language (any language includ

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread Oscar Benjamin via Python-list
On Wed, 12 Jun 2024 at 23:52, Greg Ewing via Python-list wrote: > On 13/06/24 10:09 am, Chris Angelico wrote: > > So if anyone > > actually does need to use pip with Python 2.7, they probably need to > > set up a local server > > You should also be able to download

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread Chris Angelico via Python-list
On Thu, 13 Jun 2024 at 08:46, Oscar Benjamin via Python-list wrote: > I don't know much about SSL and related networking things especially > on Windows. I would be surprised if pip on old Python can't install > from current PyPI though. I imagine that something strange has > happene

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread Greg Ewing via Python-list
On 13/06/24 4:31 am, avi.e.gr...@gmail.com wrote: It seems Microsoft is having a problem where something lik 2/3 of Windows users have not upgraded from Windows 10 after many years At least Python 3 is a clear improvement over Python 2 in many ways. Whereas the only thing Microsoft seems

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread Oscar Benjamin via Python-list
On Wed, 12 Jun 2024 at 23:11, Chris Angelico via Python-list wrote: > > On Thu, 13 Jun 2024 at 07:57, Oscar Benjamin via Python-list > wrote: > > They are seeing a warning that explicitly says "You can upgrade to a > > newer version of Python to solve this"

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread Chris Angelico via Python-list
On Thu, 13 Jun 2024 at 07:57, Oscar Benjamin via Python-list wrote: > They are seeing a warning that explicitly says "You can upgrade to a > newer version of Python to solve this". I don't know whether that SSL > warning is directly connected to pip not finding an

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread Oscar Benjamin via Python-list
On Wed, 12 Jun 2024 at 22:38, AVI GROSS via Python-list wrote: > > The discussion though was about a specific OP asking if they can fix their > problem. One solution being suggested is to fix a deeper problem and simply > make their code work with a recent version of python 3.

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread Chris Angelico via Python-list
On Thu, 13 Jun 2024 at 07:36, wrote: > But if the goal was to deprecate python 2 and in some sense phase it out, it > is perhaps not working well for some. Frankly, issuing so many updates like > 2.7 and including backporting of new features has helped make it possible to > delay

RE: Couldn't install numpy on Python 2.7

2024-06-12 Thread AVI GROSS via Python-list
Chris, Since you misunderstood, my statement was that making an incompatible set of changes to create Python 3 in the first place was a decision made by some and perhaps not one that thrilled others who already had an embedded base of programs or ones in the pipeline that would need much work

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread Chris Angelico via Python-list
On Thu, 13 Jun 2024 at 06:55, Thomas Passin via Python-list wrote: > The project cannot move to a Python-3 compatible version because Jython > 3.xx doesn't exist and may never exist. The saving grace is that my > project doesn't have to use packages like numpy, scipy, and so forth.

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread Thomas Passin via Python-list
On 6/12/2024 1:59 PM, Chris Angelico via Python-list wrote: On Thu, 13 Jun 2024 at 03:41, AVI GROSS via Python-list wrote: Change is hard even when it may be necessary. The argument often is about whether some things are necessary or not. Python made a decision but clearly not a unanimous

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread Chris Angelico via Python-list
On Thu, 13 Jun 2024 at 03:41, AVI GROSS via Python-list wrote: > > Change is hard even when it may be necessary. > > The argument often is about whether some things are necessary or not. > > Python made a decision but clearly not a unanimous one. What decision? To not releas

RE: Couldn't install numpy on Python 2.7

2024-06-12 Thread AVI GROSS via Python-list
Change is hard even when it may be necessary. The argument often is about whether some things are necessary or not. Python made a decision but clearly not a unanimous one. My current PC was not upgradable because of the new hardware requirement Microsoft decided was needed for Windows 11. I

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread MRAB via Python-list
On 2024-06-12 17:31, AVI GROSS via Python-list wrote: I am sure there is inertia to move from an older product and some people need a reason like this where the old becomes untenable. It seems Microsoft is having a problem where something lik 2/3 of Windows users have not upgraded from Windows

RE: Couldn't install numpy on Python 2.7

2024-06-12 Thread AVI GROSS via Python-list
or so for stopping updates. In that case, hardware was a concern for some as Windows 11 did not work on their machines. With upgrading python, the main concern is having to get someone to examine old code and try to make it compatible. But anyone doing new code in Python 2 in recent years should

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread Gordinator via Python-list
On 12/06/2024 12:30, marc nicole wrote: I am trying to install numpy library on Python 2.7.15 in PyCharm but the error message I get is: ERROR: Could not find a version that satisfies the requirement numpy (from versions: none) ERROR: No matching distribution found for numpy c:\python27\lib

Re: Couldn't install numpy on Python 2.7

2024-06-12 Thread Chris Angelico via Python-list
On Wed, 12 Jun 2024 at 21:32, marc nicole via Python-list wrote: > > I am trying to install numpy library on Python 2.7.15 in PyCharm but the > error message I get is: > > You can upgrade to a newer version of Python to solve this. The answer is right there in the error m

Couldn't install numpy on Python 2.7

2024-06-12 Thread marc nicole via Python-list
I am trying to install numpy library on Python 2.7.15 in PyCharm but the error message I get is: ERROR: Could not find a version that satisfies the requirement numpy (from > versions: none) > ERROR: No matching distribution found for numpy > c:\python27\lib\site-packages\pip\_vendor\url

Re: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-11 Thread HenHanna via Python-list
nk1(seq): and it's [s] within the def-body ? it seemed as if the Compiler was doing a DWIM (Do what i mean) trick. On 09/06/2024 22:20, HenHanna via Python-list wrote: Chunk, ChunkC -- nice simple way(s) to write these in Python? (Chunk  '(a a   b    a a a  

RE: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-11 Thread AVI GROSS via Python-list
', 1]] # COMMENTS The current version has flaws I have not bothered correcting. Just for a demo. -----Original Message- From: Python-list On Behalf Of Rob Cliffe via Python-list Sent: Monday, June 10, 2024 9:29 AM To: python-list@python.org Subject: Re: in Python? -- Chunk -- (ChunkC '(a a b b

Re: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-11 Thread Rob Cliffe via Python-list
output: ['aaa', 'bb', '', 'aa'] [('a', 3), ('b', 2), ('c', 4), ('a', 2)] Rob Cliffe On 09/06/2024 22:20, HenHanna via Python-list wrote: Chunk, ChunkC -- nice simple way(s) to write these in Python? (Chunk  '(a a   b    a a a   b b))     ==> ((a a) (b)  (a a a) (b b)) (Chunk  '(a a a a 

RE: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-10 Thread AVI GROSS via Python-list
> i was just curiuos about simple, clever way to write it in Python It depends on what you mean by "clever". For some, it was like a suggestion on using something already available such as itertools.groupby, perhaps even better if it is actually compiled in from a language like

Re: IDLE: clearing the screen

2024-06-10 Thread Michael F. Stemper via Python-list
-- Michael F. Stemper Indians scattered on dawn's highway bleeding; Ghosts crowd the young child's fragile eggshell mind. -- https://mail.python.org/mailman/listinfo/python-list

Re: IDLE: clearing the screen

2024-06-10 Thread Michael F. Stemper via Python-list
it return anything at all? Because __repr__ needs to return a str. Got it. Thanks for clarifying. -- Michael F. Stemper 87.3% of all statistics are made up by the person giving them. -- https://mail.python.org/mailman/listinfo/python-list

Re: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-10 Thread HenHanna via Python-list
shoot whatever we say down. A considerate person would ask questions more clearly and perhaps explain what language they are showing us code from and so on. Life is too short to waste. -Original Message- From: Python-list On Behalf Of HenHanna via Python-list Sent: Sunday, June 9, 2024 5

Re: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-10 Thread HenHanna via Python-list
On 6/9/2024 3:50 PM, MRAB wrote: On 2024-06-09 22:20, HenHanna via Python-list wrote: Chunk, ChunkC -- nice simple way(s) to write these in Python? (Chunk  '(a a   b    a a a   b b))   ==> ((a a) (b)  (a a a) (b b)) (Chunk  '(a a a a   b   c c   a a   d   e e

RE: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-09 Thread AVI GROSS via Python-list
would ask questions more clearly and perhaps explain what language they are showing us code from and so on. Life is too short to waste. -Original Message- From: Python-list On Behalf Of HenHanna via Python-list Sent: Sunday, June 9, 2024 5:20 PM To: python-list@python.org Subject: in Python

RE: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-09 Thread AVI GROSS via Python-list
would be trivial, perhaps leveraging the above. -Original Message- From: Python-list On Behalf Of HenHanna via Python-list Sent: Sunday, June 9, 2024 5:20 PM To: python-list@python.org Subject: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3)) Chunk, ChunkC -- nice simple

Re: in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-09 Thread MRAB via Python-list
On 2024-06-09 22:20, HenHanna via Python-list wrote: Chunk, ChunkC -- nice simple way(s) to write these in Python? (Chunk '(a a ba a a b b)) ==> ((a a) (b) (a a a) (b b)) (Chunk '(a a a a b c c a a d e e e e)) ==> ((a a a a) (b) (c c) (a a) (d) (e

in Python? -- Chunk -- (ChunkC '(a a b b b)), ==> ((a 2) (b 3))

2024-06-09 Thread HenHanna via Python-list
Chunk, ChunkC -- nice simple way(s) to write these in Python? (Chunk '(a a ba a a b b)) ==> ((a a) (b) (a a a) (b b)) (Chunk '(a a a a b c c a a d e e e e)) ==> ((a a a a) (b) (c c) (a a) (d) (e e e e)) (Chunk '(2 2 foo bar bar j j j k b

Re: IDLE: clearing the screen

2024-06-09 Thread Alan Gauld via Python-list
On 08/06/2024 20:18, Rob Cliffe via Python-list wrote: > OK, here is the advanced version: > import os > class _cls(object): >     def __repr__(self): >         os.system('cls') >         return '' > cls = _cls() > > Now when you type > cls > it clears the scr

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-08 Thread Grant Edwards via Python-list
On 2024-06-08, Larry Martell via Python-list wrote: > The original question struck me as homework or an interview question for a > junior position. But having no clear requirements or specifications is good > training for the real world where that is often the case. When you question &g

RE: From JoyceUlysses.txt -- words occurring exactly once

2024-06-08 Thread AVI GROSS via Python-list
simple way of making words. Note, the above logic applies not to just python but most programming environments. If someone interviewed me for a job in say, Rust, which I am just now learning out of curiosity, I might not know how to program some parts of a problem like this, let alone make use

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-08 Thread Thomas Passin via Python-list
ience, it cannot be expected they can tell you up-front what they want. One danger of languages like Python is that often people get the code you supply and modify it themselves or reuse it on some project they consider similar. That can be a good thing but often a mess as you wrote the code

Re: IDLE: clearing the screen

2024-06-08 Thread Rob Cliffe via Python-list
uot; prompt appears on the SECOND line. (This blank line is because the IDLE prints the blank value returned by "return ''" and adds a newline to it, as it does when printing the value of any expression.) Best wishes Rob Cliffe -- https://mail.python.org/mailman/listinfo/python-list

RE: From JoyceUlysses.txt -- words occurring exactly once

2024-06-08 Thread AVI GROSS via Python-list
etter for their display than required. But until people see such output, unless they have lots of experience, it cannot be expected they can tell you up-front what they want. One danger of languages like Python is that often people get the code you supply and modify it themselves or reuse it on

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-08 Thread Thomas Passin via Python-list
On 6/8/2024 11:54 AM, Larry Martell via Python-list wrote: On Sat, Jun 8, 2024 at 10:39 AM Mats Wichmann via Python-list < python-list@python.org> wrote: On 6/5/24 05:10, Thomas Passin via Python-list wrote: Of course, we see this lack of clarity all the time in questions to the li

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-08 Thread Larry Martell via Python-list
On Sat, Jun 8, 2024 at 10:39 AM Mats Wichmann via Python-list < python-list@python.org> wrote: > On 6/5/24 05:10, Thomas Passin via Python-list wrote: > > > Of course, we see this lack of clarity all the time in questions to the > > list. I often wonder how these ask

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-08 Thread Mats Wichmann via Python-list
On 6/5/24 05:10, Thomas Passin via Python-list wrote: Of course, we see this lack of clarity all the time in questions to the list.  I often wonder how these askers can possibly come up with acceptable code if they don't realize they don't truly know what it's supposed to do. Fortunately

[RELEASE] Python 3.12.4 released

2024-06-06 Thread Thomas Wouters via Python-list
Last minute bugs in test environments notwithstanding, 3.12.4 is now available! https://www.python.org/downloads/release/python-3124/ <https://www.python.org/downloads/release/python-3124/> <https://discuss.python.org/t/python-3-12-4-now-available/55128#this-is-the-third-maintenanc

[RELEASE] Python 3.13.0 beta 2 released.

2024-06-06 Thread Thomas Wouters via Python-list
After a little bit of a delay (I blame the flat tire on my rental car), 3.13.0b2 is released: https://www.python.org/downloads/release/python-3130b2/ <https://www.python.org/downloads/release/python-3130b2/> <https://discuss.python.org/t/3-13-0b2-now-available/55056#this-is-a-bet

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-06 Thread Thomas Passin via Python-list
On 6/5/2024 12:33 AM, dn via Python-list wrote: On 31/05/24 14:26, HenHanna via Python-list wrote: On 5/30/2024 2:18 PM, dn wrote: On 31/05/24 08:03, HenHanna via Python-list wrote: Given a text file of a novel (JoyceUlysses.txt) ... could someone give me a pretty fast (and simple) Python

Re: Fwd: IDLE: clearing the screen

2024-06-05 Thread Rob Cliffe via Python-list
function returns None. So:     def cls():     os.system("cls") should be just fine. Yes, you're right. Rob Cliffe -- https://mail.python.org/mailman/listinfo/python-list

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-05 Thread Grant Edwards via Python-list
On 2024-06-05, dn via Python-list wrote: > If you/your teacher can't define a "word", the code, any code, will > almost-certainly be wrong! Back when I was a student... When there was a homework/project assignemnt with a vague requirement (and it wasn't practical to get

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-04 Thread dn via Python-list
On 31/05/24 14:26, HenHanna via Python-list wrote: On 5/30/2024 2:18 PM, dn wrote: On 31/05/24 08:03, HenHanna via Python-list wrote: Given a text file of a novel (JoyceUlysses.txt) ... could someone give me a pretty fast (and simple) Python program that'd give me a list of all words

Re: Fwd: IDLE: clearing the screen

2024-06-04 Thread Cameron Simpson via Python-list
os.system("cls") should be just fine. -- https://mail.python.org/mailman/listinfo/python-list

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-04 Thread Chris Angelico via Python-list
On Wed, 5 Jun 2024 at 02:49, Edward Teach via Python-list wrote: > > On Mon, 03 Jun 2024 14:58:26 -0400 (EDT) > Grant Edwards wrote: > > > On 2024-06-03, Edward Teach via Python-list > > wrote: > > > > > The Gutenburg Project publishes "plain text&quo

Fwd: IDLE: clearing the screen

2024-06-04 Thread Rob Cliffe via Python-list
Welcome to Python!  A great language for program development. Answers might be platform-dependent (are you using WIndows, Linux, etc.). However, the following works for me on WIndows.  You can put it in the startup.py file so you don't have to type it every time you start up the IDLE. import

RE: From JoyceUlysses.txt -- words occurring exactly once

2024-06-04 Thread AVI GROSS via Python-list
counts and so on. As mentioned, the default native format in Python is UNICODE and ASCII files being read in may well be UNICODE internally unless you carefully ask otherwise. The conversion from ASCII to UNICODE is trivial. As for how well the regular expressions like \w work in general, I

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-04 Thread Grant Edwards via Python-list
On 2024-06-04, Edward Teach via Python-list wrote: > On Mon, 03 Jun 2024 14:58:26 -0400 (EDT) > Grant Edwards wrote: > >> On 2024-06-03, Edward Teach via Python-list >> wrote: >> >> > The Gutenburg Project publishes "plain text". That's another

IDLE: clearing the screen

2024-06-04 Thread Cave Man via Python-list
Hello everyone, I am new to Python, and I have been using IDLE (v3.10.11) to run small Python code. However, I have seen that the output scrolls to the bottom in the output window. Is there a way to clear the output window (something like cls in command prompt or clear in terminal), so

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-04 Thread Edward Teach via Python-list
On Mon, 03 Jun 2024 14:58:26 -0400 (EDT) Grant Edwards wrote: > On 2024-06-03, Edward Teach via Python-list > wrote: > > > The Gutenburg Project publishes "plain text". That's another > > problem, because "plain text" means UTF-8and that means

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-04 Thread Dieter Maurer via Python-list
of course with enhanced letter, digits, punctuation, etc.) -- https://mail.python.org/mailman/listinfo/python-list

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-03 Thread Grant Edwards via Python-list
On 2024-06-03, Edward Teach via Python-list wrote: > The Gutenburg Project publishes "plain text". That's another > problem, because "plain text" means UTF-8and that means > unicode...and that means running some sort of unicode-to-ascii > conversion in or

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-03 Thread Edward Teach via Python-list
On Sat, 1 Jun 2024 13:34:11 -0600 Mats Wichmann wrote: > On 5/31/24 11:59, Dieter Maurer via Python-list wrote: > > hmmm, I "sent" this but there was some problem and it remained > unsent. Just in case it hasn't All Been Said Already, here's the > retry: > > >

Cannot install python properly - python310.dll not found - no pip

2024-06-03 Thread Jay Cadet | Studio JPC via Python-list
Hi. I'm attempting to install and use stable diffusion. However, while installing python 3.10.6, I'm getting the error that the python 310.dll is not found. I've made sure the PATH option is enabled, but it makes no difference. I've also removed and reinstalled python multiple times. Even

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-01 Thread Mats Wichmann via Python-list
On 5/31/24 11:59, Dieter Maurer via Python-list wrote: hmmm, I "sent" this but there was some problem and it remained unsent. Just in case it hasn't All Been Said Already, here's the retry: HenHanna wrote at 2024-5-30 13:03 -0700: Given a text file of a novel (JoyceUlysses.txt)

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-01 Thread Thomas Passin via Python-list
On 6/1/2024 4:04 AM, Peter J. Holzer via Python-list wrote: On 2024-05-30 19:26:37 -0700, HenHanna via Python-list wrote: hard to decide what to do with hyphens and apostrophes (I'd, he's, can't, haven't, A's and B's) Especially since the same character

Re: Lprint = ( Lisp-style printing ( of lists and strings (etc.) ) in Python )

2024-06-01 Thread Peter J. Holzer via Python-list
On 2024-05-30 21:47:14 -0700, HenHanna via Python-list wrote: > [('the', 36225), ('and', 17551), ('of', 16759), ('i', 16696), ('a', 15816), > ('to', 15722), ('that', 11252), ('in', 10743), ('it', 10687)] > > ((the 36225) (and 17551) (of 16759) (i 16696) (a 15816) (to 15722) (

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-01 Thread Peter J. Holzer via Python-list
On 2024-05-30 19:26:37 -0700, HenHanna via Python-list wrote: > hard to decide what to do with hyphens >and apostrophes > (I'd, he's, can't, haven't, A's and B's) Especially since the same character is used as both an apostrophe and a closing quota

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-05-31 Thread Thomas Passin via Python-list
On 5/30/2024 4:03 PM, HenHanna via Python-list wrote: Given a text file of a novel (JoyceUlysses.txt) ... could someone give me a pretty fast (and simple) Python program that'd give me a list of all words occurring exactly once?   -- Also, a list of words occurring once, twice

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-05-31 Thread Dieter Maurer via Python-list
HenHanna wrote at 2024-5-30 13:03 -0700: > >Given a text file of a novel (JoyceUlysses.txt) ... > >could someone give me a pretty fast (and simple) Python program that'd >give me a list of all words occurring exactly once? Your task can be split into several subtasks: * parse the

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-05-31 Thread Grant Edwards via Python-list
On 2024-05-31, Pieter van Oostrum via Python-list wrote: > HenHanna writes: > >> Given a text file of a novel (JoyceUlysses.txt) ... >> >> could someone give me a pretty fast (and simple) Python program that'd >> give me a list of all words occurring exactly onc

Lprint = ( Lisp-style printing ( of lists and strings (etc.) ) in Python )

2024-05-31 Thread HenHanna via Python-list
;;; Pls tell me about little tricks you use in Python or Lisp. [('the', 36225), ('and', 17551), ('of', 16759), ('i', 16696), ('a', 15816), ('to', 15722), ('that', 11252), ('in', 10743), ('it', 10687)] ((the 36225) (and 17551) (of 16759) (i 16696) (a 15816) (to 15722) (that 11252

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-05-31 Thread HenHanna via Python-list
On 5/30/2024 2:18 PM, dn wrote: On 31/05/24 08:03, HenHanna via Python-list wrote: Given a text file of a novel (JoyceUlysses.txt) ... could someone give me a pretty fast (and simple) Python program that'd give me a list of all words occurring exactly once?    -- Also, a list

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-05-31 Thread Pieter van Oostrum via Python-list
HenHanna writes: > Given a text file of a novel (JoyceUlysses.txt) ... > > could someone give me a pretty fast (and simple) Python program that'd > give me a list of all words occurring exactly once? > > -- Also, a list of words occurring once, twice or

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-05-30 Thread dn via Python-list
On 31/05/24 08:03, HenHanna via Python-list wrote: Given a text file of a novel (JoyceUlysses.txt) ... could someone give me a pretty fast (and simple) Python program that'd give me a list of all words occurring exactly once?   -- Also, a list of words occurring once, twice

From JoyceUlysses.txt -- words occurring exactly once

2024-05-30 Thread HenHanna via Python-list
Given a text file of a novel (JoyceUlysses.txt) ... could someone give me a pretty fast (and simple) Python program that'd give me a list of all words occurring exactly once? -- Also, a list of words occurring once, twice or 3 times re: hyphenated words(you can

Re: Any marginally usable programming language approaches an ill defined barely usable re-implementation of half of Common-Lisp

2024-05-29 Thread Dan Sommers via Python-list
On 2024-05-29 at 11:39:14 -0700, HenHanna via Python-list wrote: > On 5/27/2024 1:59 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: > > https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule [...] > Are the Rules 1--9 by Greenspun good too? I don't know; let me loo

Re: Serializing pydantic enums

2024-05-29 Thread Mats Wichmann via Python-list
On 5/29/24 13:27, Larry Martell via Python-list wrote: On Tue, May 28, 2024 at 11:46 AM Left Right via Python-list wrote: Most Python objects aren't serializable into JSON. Pydantic isn't special in this sense. What can you do about this? -- Well, if this is a one-of situation, then, maybe

Re: Serializing pydantic enums

2024-05-29 Thread Larry Martell via Python-list
On Wed, May 29, 2024 at 12:27 PM Larry Martell wrote: > > On Tue, May 28, 2024 at 11:46 AM Left Right via Python-list > wrote: > > > > Most Python objects aren't serializable into JSON. Pydantic isn't > > special in this sense. > > > > What can you d

Re: SOLVED! Re: Weird Stuff (Markdown, syntax highlighting and Python)

2024-05-29 Thread dn via Python-list
On 29/05/24 06:49, Gilmeh Serda via Python-list wrote: Solved by using a different method. Hedonist for hire... no job too easy! This combination of sig-file and content seems sadly ironic. How about CONTRIBUTING to the community by explaining 'the solution' to people who may find

Re: Any marginally usable programming language approaches an ill defined barely usable re-implementation of half of Common-Lisp

2024-05-29 Thread Kaz Kylheku via Python-list
adio interface to Caterpillar vehicle, including CRCC error detection * automatically generated user interface" -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @kazina...@mstdn.ca -- https://mail.python.org/mailman/listinfo/python-list

Re: Any marginally usable programming language approaches an ill defined barely usable re-implementation of half of Common-Lisp

2024-05-29 Thread HenHanna via Python-list
On 5/27/2024 1:59 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: On 2024-05-27 at 12:37:01 -0700, HenHanna via Python-list wrote: On 5/27/2024 7:18 AM, Cor wrote: Some entity, AKA "B. Pym" , wrote this mindboggling stuff: (selectively-snipped-or-not-p) On 12/16/2023, c...@clsne

Re: Serializing pydantic enums

2024-05-29 Thread Larry Martell via Python-list
On Tue, May 28, 2024 at 11:46 AM Left Right via Python-list wrote: > > Most Python objects aren't serializable into JSON. Pydantic isn't > special in this sense. > > What can you do about this? -- Well, if this is a one-of situation, > then, maybe just do it by hand? > >

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Thomas Passin via Python-list
On 5/29/2024 10:59 AM, MRAB via Python-list wrote: On 2024-05-29 15:32, Thomas Passin via Python-list wrote: On 5/29/2024 8:55 AM, Kevin M. Wilson wrote: Please recall, I said the format for the email failed to retain the proper indents. I'll attach a picture of the code! Purpose

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Grant Edwards via Python-list
On 2024-05-29, Mats Wichmann via Python-list wrote: > On 5/29/24 08:02, Grant Edwards via Python-list wrote: >> On 2024-05-29, Chris Angelico via Python-list wrote: >> >>> print(f"if block {name[index]=} {index=}") >> >> Holy cow! How did I not kn

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread MRAB via Python-list
On 2024-05-29 15:32, Thomas Passin via Python-list wrote: On 5/29/2024 8:55 AM, Kevin M. Wilson wrote: Please recall, I said the format for the email failed to retain the proper indents. I'll attach a picture of the code! Purpose; to uppercase every other letter in a string. Thanks all, KMW

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Barry Scott via Python-list
> On 29 May 2024, at 05:38, Kevin M. Wilson via Python-list > wrote: > > The format in this email is not of my making, should someone know, how to do > this so that it's a readable script do tell! > KMW Your mail program may have a plain-text mode to compose mes

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Thomas Passin via Python-list
*Isaiah 43:2 * On Wednesday, May 29, 2024 at 06:19:56 AM MDT, Thomas Passin via Python-list wrote: On 5/29/2024 3:14 AM, Chris Angelico via Python-list wrote: > On Wed, 29 May 2024 at 16:03, Cameron Simpson via Python-list > mailto:python-list@python.org>> wrote: >>

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Mats Wichmann via Python-list
On 5/29/24 08:02, Grant Edwards via Python-list wrote: On 2024-05-29, Chris Angelico via Python-list wrote: print(f"if block {name[index]=} {index=}") Holy cow! How did I not know about the f-string {=} thing? It's more recent than f-strings in general, so it's not that ha

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Grant Edwards via Python-list
On 2024-05-29, Chris Angelico via Python-list wrote: > print(f"if block {name[index]=} {index=}") Holy cow! How did I not know about the f-string {=} thing? -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Formatted Output and Argument Parsing (was: Re: Flubbed it in the second interation through the string: range error... HOW?)

2024-05-29 Thread Chris Angelico via Python-list
On Wed, 29 May 2024 at 23:06, Dan Sommers via Python-list wrote: > (For the history-impaired, getopt existed long before Python and will > likely exist long after it, but getopt's "replacement" optparse lasted > only from 2003 until 2011.) Depends on your definition of "l

Formatted Output and Argument Parsing (was: Re: Flubbed it in the second interation through the string: range error... HOW?)

2024-05-29 Thread Dan Sommers via Python-list
On 2024-05-29 at 17:14:51 +1000, Chris Angelico via Python-list wrote: > I wouldn't replace str.format() everywhere, nor would I replace > percent encoding everywhere - but in this case, I think Thomas is > correct. Not because it's 2024 (f-strings were brought in back in > 2015

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Thomas Passin via Python-list
On 5/29/2024 3:14 AM, Chris Angelico via Python-list wrote: On Wed, 29 May 2024 at 16:03, Cameron Simpson via Python-list wrote: By which Thomas means stuff like this: print(f'if block {name[index]} and index {index}') Notice the leading "f'". Personally I wouldn't even g

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread MRAB via Python-list
On 2024-05-29 05:33, Kevin M. Wilson via Python-list wrote: The following is my effort to understand how to process a string, letter, by letter: def myfunc(name):        index = 0    howmax = len(name)    # while (index <= howmax):    while (index < howmax):        if (index %

Re: SOLVED! Re: Weird Stuff (Markdown, syntax highlighting and Python)

2024-05-29 Thread o1bigtenor via Python-list
On Tue, May 28, 2024 at 9:48 PM Gilmeh Serda via Python-list < python-list@python.org> wrote: > > Solved by using a different method. > > - - - And that was how? TIA -- https://mail.python.org/mailman/listinfo/python-list

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Chris Angelico via Python-list
On Wed, 29 May 2024 at 16:03, Cameron Simpson via Python-list wrote: > By which Thomas means stuff like this: > > print(f'if block {name[index]} and index {index}') > > Notice the leading "f'". Personally I wouldn't even go that far, just: > > print('if

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Cameron Simpson via Python-list
't even go that far, just: print('if block', name[index], 'and index', index) But there are plenty of places where f-strings are very useful. -- https://mail.python.org/mailman/listinfo/python-list

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-28 Thread Thomas Passin via Python-list
for i, chr in enumerate(name): # do something with the character Also, it's 2024 ... time to start using f-strings (because they are more readable than str.format()) On 5/29/2024 12:33 AM, Kevin M. Wilson via Python-list wrote: The following is my effort to understand how to process a string, letter,

Fw: Flubbed it in the second interation through the string: range error... HOW?

2024-05-28 Thread Kevin M. Wilson via Python-list
over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze."      Isaiah 43:2 - Forwarded Message - From: Kevin M. Wilson via Python-list To: python-list@python.org Sent: Tuesday, May 28, 2024 at 10:35:23 PM MDTSubject

Flubbed it in the second interation through the string: range error... HOW?

2024-05-28 Thread Kevin M. Wilson via Python-list
s through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze."      Isaiah 43:2 -- https://mail.python.org/mailman/listinfo/python-list

Re: Serializing pydantic enums

2024-05-28 Thread Left Right via Python-list
Most Python objects aren't serializable into JSON. Pydantic isn't special in this sense. What can you do about this? -- Well, if this is a one-of situation, then, maybe just do it by hand? If this is a recurring problem: json.dumps() takes a cls argument that will be used to do the serialization

Serializing pydantic enums

2024-05-28 Thread Larry Martell via Python-list
FinishReason is not JSON serializable I get the object not the value: (Pdb) Choice(finish_reason=FinishReason.stop) Choice(finish_reason=) Also tried it with .value, same result. What am I missing here? -- https://mail.python.org/mailman/listinfo/python-list

Re: Weird Stuff (Markdown, syntax highlighting and Python)

2024-05-27 Thread Thomas Passin via Python-list
On 5/26/2024 2:28 AM, Gilmeh Serda via Python-list wrote: The web claims (I think on all pages I've read about Markdown and Python) that this code should work, with some very minor variants on the topic: ```python import os with open(os.path.join('/home/user/apath', 'somefile')) as f

Re: Any marginally usable programming language approaches an ill defined barely usable re-implementation of half of Common-Lisp

2024-05-27 Thread Dan Sommers via Python-list
On 2024-05-27 at 12:37:01 -0700, HenHanna via Python-list wrote: > > On 5/27/2024 7:18 AM, Cor wrote: > > Some entity, AKA "B. Pym" , > > wrote this mindboggling stuff: > > (selectively-snipped-or-not-p) > > > > > On 12/16/2023, c...@clsn

Re: Weird Stuff (Markdown, syntax highlighting and Python)

2024-05-27 Thread dn via Python-list
umentation systems; here, the objective appears to be using Python to generate Markdown. How much have you used Markdown to any serious degree, before attempting this feat? On 26/05/24 18:28, Gilmeh Serda via Python-list wrote: The web claims (I think on all pages I've read about Markdown

Any marginally usable programming language approaches an ill defined barely usable re-implementation of half of Common-Lisp

2024-05-27 Thread HenHanna via Python-list
of common-lisp The good news is, it's not Lisp that sucks, but Common Lisp. --- Paul Graham Just to set the record straight; This is not My line. I quoted it but don't know who the originator of that remark is. Cor a few years ago... when i started learning Python... it was so

  1   2   3   4   5   6   7   8   9   10   >