Re: Changing 'Scripts/*.exe'

2022-10-03 Thread Meredith Montgomery
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Meredith Montgomery writes: >>Wouldn't it be great if it were portable by default? > > I think under Windows there is a division of software > suggested by Microsoft, a division of software into > executable code an

Re: on GNU EMACS's python-mode, loading entire buffer

2022-10-03 Thread Meredith Montgomery
Stephen Berman writes: > On Sun, 04 Sep 2022 16:47:07 -0300 Meredith Montgomery > wrote: > >> Meredith Montgomery writes: >> >>> Meredith Montgomery writes: >>> >>> [...] >>> >>>> I would also be interested in a command that

Re: Changing 'Scripts/*.exe'

2022-10-03 Thread Meredith Montgomery
Gisle Vanem writes: > Hello list. > > I'm moved my old Python27 installation from > f:\ProgramFiler\Python27 ( == 'ProgramFiles') > to > f:\gv\Python27 > > and now many 'scripts/*.exe' program fails > to start since the old path to 'Python.exe' > is wrong. > > E.g. 'Scripts/pip2.exe' has the

Re: on implementing a toy oop-system

2022-09-29 Thread Meredith Montgomery
r...@zedat.fu-berlin.de (Stefan Ram) writes: [...] >>>However, to evaluate a method call such as "o.m( a, a1, ... )", >>>currying does not necessarily have to be used. One can as well >>>determine the function to be used for "m" from the type of "o" >>>and then call that function with arguments

Re: on implementing a toy oop-system

2022-09-29 Thread Meredith Montgomery
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Meredith Montgomery writes: >>The code below works, but you can see it's kinda ugly. I wish I could >>uncurry a procedure, but I don't think this is possible. (Is it?) > > from functools import partial > from op

Re: on implementing a toy oop-system

2022-09-28 Thread Meredith Montgomery
Meredith Montgomery writes: > r...@zedat.fu-berlin.de (Stefan Ram) writes: > >> Meredith Montgomery writes: >>>Is that at all possible somehow? Alternatively, how would you do your >>>toy oop-system? >> >> Maybe something along those lines: >

Re: on implementing a toy oop-system

2022-09-23 Thread Meredith Montgomery
Chris Angelico writes: > On Sat, 24 Sept 2022 at 07:52, Meredith Montgomery > wrote: >> >> def Counter(name = None): >> o = {"name": name if name else "untitled", "n": 0} >> def inc(o): >> o["n"] += 1 >>

Re: on implementing a toy oop-system

2022-09-23 Thread Meredith Montgomery
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Meredith Montgomery writes: >>Is that at all possible somehow? Alternatively, how would you do your >>toy oop-system? > > Maybe something along those lines: > > from functools import partial > > def counter_c

Re: Question about learning Python

2022-09-09 Thread Meredith Montgomery
writes: > Maybe we should ask WHY the person asking the question about how to learn a > computer language called Python is pairing it with the idea of whether to > also learn C. Excellent point! -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about learning Python

2022-09-07 Thread Meredith Montgomery
Maruful Islam writes: > I want to start learning python. I have a question about learning python. > > Is learning C essential or not for learning python? Surely not necessary. There's a generous recent thread about books on Python. Have a look at it. -- https://mail.python.org/mailman/listin

Re: any author you find very good has written a book on Python?

2022-09-07 Thread Meredith Montgomery
jkn writes: > On Tuesday, September 6, 2022 at 4:36:38 PM UTC+1, Meredith Montgomery wrote: >> Paul Rubin writes: >> >> > Meredith Montgomery writes: >> >> So that's my request --- any author you find very good has written a >> >> book

Re: on str.format and f-strings

2022-09-06 Thread Meredith Montgomery
Chris Angelico writes: > On Wed, 7 Sept 2022 at 03:52, Meredith Montgomery > wrote: >> >> It seems to me that str.format is not completely made obsolete by the >> f-strings that appeared in Python 3.6. But I'm not thinking that this >> was the objective of

Re: any author you find very good has written a book on Python?

2022-09-06 Thread Meredith Montgomery
Paul Rubin writes: > Meredith Montgomery writes: >> So that's my request --- any author you find very good has written a >> book on Python? > > The ones by David Beazley are great. Same with his non-book writings > about Python. See: http://dabeaz.com/ Distilled

any author you find very good has written a book on Python?

2022-09-06 Thread Meredith Montgomery
I never read a book on Python. I'm looking for a good one now. I just searched the web for names such as Charles Petzold, but it looks like he never wrote a book on Python. I also searched for Peter Seibel, but he also never did. I also tried to search for Richard Heathfield. (I took a look at

Re: on the importance of exceptions

2022-09-06 Thread Meredith Montgomery
Meredith Montgomery writes: > I'm trying to show people that exceptions are a very nice thing to have > when it comes to detecting when something went awry somewhere. I'd like > a real-world case, though. Here's my contribution. I want to handle all errors in main()

Re: on str.format and f-strings

2022-09-06 Thread Meredith Montgomery
Julio Di Egidio writes: > On Tuesday, 6 September 2022 at 01:03:02 UTC+2, Meredith Montgomery wrote: >> Julio Di Egidio writes: >> > On Monday, 5 September 2022 at 22:18:58 UTC+2, Meredith Montgomery wrote: >> >> r...@zedat.fu-berlin.de (Stefan Ram) writes:

on the importance of exceptions

2022-09-06 Thread Meredith Montgomery
I'm trying to show people that exceptions are a very nice thing to have when it comes to detecting when something went awry somewhere. I'd like a real-world case, though. Here's what I'm sort of coming up with --- given my limited experience and imagination. Below, you have f calling g caling

Re: on str.format and f-strings

2022-09-06 Thread Meredith Montgomery
Julio Di Egidio writes: > On Monday, 5 September 2022 at 22:18:58 UTC+2, Meredith Montgomery wrote: >> r...@zedat.fu-berlin.de (Stefan Ram) writes: > >> > , but with the spaces removed, it's even one character >> > shorter than the format expression: >&g

Re: on str.format and f-strings

2022-09-06 Thread Meredith Montgomery
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Meredith Montgomery writes: > ... >> d = { "name": "Meredith", "email": "mmontgom...@levado.to" } >> return "The name is {name} and the email is {email}".format(**d) >>--8&

Re: on implementing a toy oop-system

2022-09-06 Thread Meredith Montgomery
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Meredith Montgomery writes: >>Is that at all possible somehow? Alternatively, how would you do your >>toy oop-system? > > Maybe something along those lines: > > from functools import partial > > def counter_c

on str.format and f-strings

2022-09-06 Thread Meredith Montgomery
It seems to me that str.format is not completely made obsolete by the f-strings that appeared in Python 3.6. But I'm not thinking that this was the objective of the introduction of f-strings: the PEP at https://peps.python.org/pep-0498/#id11 says so explicitly. My question is whether f-strin

Re: on GNU EMACS's python-mode, loading entire buffer

2022-09-06 Thread Meredith Montgomery
Meredith Montgomery writes: > Meredith Montgomery writes: > > [...] > >> I would also be interested in a command that restarts the REPL afresh >> and reloads my buffer --- sort of like keyboard's [F5] of the IDLE. > > A partial solution for this is the fol

on implementing a toy oop-system

2022-09-06 Thread Meredith Montgomery
Just for investigation sake, I'm trying to simulate OO-inheritance. (*) What did I do? I decided that objects would be dictionaries and methods would be procedures stored in the object. A class is just a procedure that creates such object-dictionary. So far so good. Trouble arrived when I

Re: on GNU EMACS's python-mode, loading entire buffer

2022-08-31 Thread Meredith Montgomery
Meredith Montgomery writes: [...] > I would also be interested in a command that restarts the REPL afresh > and reloads my buffer --- sort of like keyboard's [F5] of the IDLE. A partial solution for this is the following procedure. --8<---cut here--

Re: Coffee

2022-08-31 Thread Meredith Montgomery
"Michael F. Stemper" writes: > On 29/08/2022 07.16, Stefan Ram wrote: >> |Python's obviously a great tool for all kinds of programming things, >> |and I would say if you're only gonna use one programming >> |language in your live, Python will probably the right one. >> Brian Kernighan >>I tra

Re: on GNU EMACS's python-mode, loading entire buffer

2022-08-29 Thread Meredith Montgomery
Paul Rubin writes: > Meredith Montgomery writes: >> Now in 27.1, things are different. I say C-c C-c and it tells me to >> start the process with C-c C-p. I mean --- is that the most polite >> thing to do? I feel like it's telling me --- go send this buffer >&

on GNU EMACS's python-mode, loading entire buffer

2022-08-29 Thread Meredith Montgomery
Perhaps this isn't the right newsgroup, but I kinda feel I will find more GNU EMACS users running the native python-mode here than in GNU EMACS newsgroups. Not every GNU EMACS user cares about Python. (Right?) A sort of a complaint is that when I used to run GNU EMACS 24.3.1, I'd open a file.py a

Re: Coffee

2022-08-29 Thread Meredith Montgomery
r...@zedat.fu-berlin.de (Stefan Ram) writes: > |Python's obviously a great tool for all kinds of programming things, > |and I would say if you're only gonna use one programming > |language in your live, Python will probably the right one. > Brian Kernighan > > I transcribed this from the recent

on a statement followed by an expression

2022-06-04 Thread Meredith Montgomery
(*) Question How can I, in a single line, write a statement followed by an expression? For example, if /d/ is a dicionary, how can I write d["key"] = value # and somehow making this line end up with d (*) Where does the question come from? >From the following experiment-exercise. (*) Intro

Re: how to distinguish return from print()

2022-05-25 Thread Meredith Montgomery
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Meredith Montgomery writes: > ... >>def f(x): >>return x + 1 > ... >>>>> print("hello") > > To me, what would make more sense would be: > > Teacher: > > |>>>

how to distinguish return from print()

2022-05-22 Thread Meredith Montgomery
Students seeing a programming language for the first time and using Python's REPL for the first time have asked me what is the difference between a return statement and a print() call. They got a point. --8<---cut here---start->8--- def f(x): return x + 1