venv and packages with entry points

2022-09-06 Thread c . buhtz

Hello,

I try to get it onto my head how virtual environments (via venv) works 
when I have packages with "entry points".


I can define such entry points in the setup.cfg like this (full example 
[1]):


[options.entry_points]
console_scripts =
hyperorg = hyperorg.__main__:main

When I install such a package via pip the result is a shell script in 
/usr/bin/...


What happens when I install such a package with an entry point via "pip 
install ." when an virtual environment is activated?


Kind
Christian

[1] -- 


--
https://mail.python.org/mailman/listinfo/python-list


Re: Humour

2022-09-06 Thread alister via Python-list
On Sun, 4 Sep 2022 02:08:20 -0700 (PDT), Ali Muhammad wrote:

> Hi python devs it seems you do not have a sense of humour and I am here
> to change that please I request to make it so on April 1st you change
> the print function to a capital P this will be funny and people will use
> language therefore you get more people more money more devs and happier
> people in the world take action to solve depression.

You may want to check the language History (unless you were deliberately 
taking the 'P' & I missed it ) :-)



-- 
Hildebrant's Principle:
If you don't know where you are going, any road will get you 
there.
-- 
https://mail.python.org/mailman/listinfo/python-list


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
decided to have inheritance.  The problem might related to the
lexical-nature of closures, but I'm not sure.

(*) A problem 

Say I have a Counter-creating object procedure and a Car-creating object
procedure.  Cars want to track how many times they park, so they inherit
a counter.  

--8<---cut here---start->8---
def Car(maker = None, color = None):
  o = inherit(Object(), Counter())
  o["maker"] = maker
  o["color"] = color
  o["speed"] = 0
--8<---cut here---end--->8---

What Object() does is just to return a dictionary.  What inherit() does
is just to merge the two dictionaries into a single one (to be used by
the Car procedure).

This didn't come out as I expected, though.  Let me show you
step-by-step where the problem is.  First, here's a counter in action.

>>> c1 = Counter()
>>> c1["inc"]()["inc"]()
{'id': .id at 0x016547C648B0>, 'n': 2, [...]}
>>> c1["n"]
2

That's good and expected: I incremented it twice.  But look what happens
with a Car's counter.

>>> c = Car()
>>> c = Car()
>>> c
{'id': .id at 0x016547C64B80>, 'n': 0,
  'inc': .inc at 0x016547C64C10>, 'dec':
  .dec at 0x016547C64CA0>, 'maker': None,
  'color': None, 'speed': 0, 'accelerate': .accelerate at 0x016547C64AF0>, 'park': .park at 0x016547C64D30>}

>>> c["inc"]()
{'id': .id at 0x016547C64B80>, 'n': 1,
  'inc': .inc at 0x016547C64C10>, 'dec':
  .dec at 0x016547C64CA0>}

We can see something got incremented!  But... 

>>> c["n"]
0

Indeed, what got incremented is the dictionary attached to the /inc/
procedure of the Counter closure, so it's that dictionary that's being
mutated.  My /inherit/ procedure is not able to bring that procedure
into the Car dictionary.  

Is that at all possible somehow?  Alternatively, how would you do your
toy oop-system?

(*) Full code below

from random import random

def Object():
  myid = random()
  def id():
return myid
  return {
"id": id
  }

def inherit(o, parentObject):
  o.update(parentObject)
  return o

def Counter(begin_at = 0):
  o = Object()
  o["n"] = begin_at
  def inc():
nonlocal o
o["n"] += 1
return o
  o["inc"] = inc
  def dec():
nonlocal o
o["n"] -= 1
return o
  o["dec"] = dec
  return o

def Car(maker = None, color = None):
  o = inherit(Object(), Counter())
  o["maker"] = maker
  o["color"] = color
  o["speed"] = 0
  def accelerate(speed):
nonlocal o
print(f"Car-{o['id']()}: accelerating to {speed}...")
o["speed"] = speed
return o
  o["accelerate"] = accelerate
  def park():
nonlocal o
o["speed"] = 0
o["parked"] = True
o["inc"]()
print(f"Car-{o['id']()}: parked! ({o['n']} times)")
return o
  o["park"] = park
  return o

def tests():
  c1 = Counter()
  c2 = Counter(100)
  c1["inc"]()["inc"]()
  c2["dec"]()["dec"]()["dec"]()
  print("c1 is 2:", c1["n"])
  print("c2 is 97:", c2["n"])
  car1 = Car("VW", "Red")
  car1["accelerate"](100)
  print("speed is 100:", car1["speed"])
  car2 = Car("Ford", "Black")
  car2["accelerate"](120)["park"]()
  car2["accelerate"](50)["park"]()
  print("has parked 2 times:", car2["n"])
-- 
https://mail.python.org/mailman/listinfo/python-list


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 following procedure.
>
> (defun python-revert-and-send-buffer-to-repl ()
>   "Revert current buffer and sends it to the Python REPL."
>   (interactive)
>   (revert-buffer "ignore-auto-no" "no-confirm")
>   (python-shell-send-buffer))
>
> We can map this to the F5-key and that improves things.  But a restart
> of the REPL would be the ideal.  (Sometimes we really want to start
> afresh.  Sometimes.  Most often we don't want that.)

It's not easy to restart the REPL.  You can send "quit()" to it and
invoke run-python again interactively by typing out one command after
another, but if you write a procedure such as this one below, it doesn't
work: it gives me the impression that there's a timing issue, that is,
perhaps the procedure is too fast and something happens before it
should.

(defun python-save-send-buffer-to-repl ()
  (interactive)
  (save-buffer)
  (python-shell-send-string "quit()")
  (run-python)
  (python-shell-send-buffer)
  (python-shell-switch-to-shell))
-- 
https://mail.python.org/mailman/listinfo/python-list


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-strings can do the
following nice thing with dictionaries that str.format can do:

--8<---cut here---start->8---
def f():
  d = { "name": "Meredith", "email": "mmontgom...@levado.to" }
  return "The name is {name} and the email is {email}".format(**d)
--8<---cut here---end--->8---

Is there a way to do this with f-strings?
-- 
https://mail.python.org/mailman/listinfo/python-list


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_create( object ):
> object[ "n" ]= 0
> def counter_increment( object ):
> object[ "n" ]+= 1
> def counter_value( object ):
> return object[ "n" ]
>
> counter_class =( counter_create, counter_increment, counter_value )
>
> def inherit_from( class_, target ):
> class_[ 0 ]( target )
> for method in class_[ 1: ]:
> target[ method.__name__ ]= partial( method, target )
>
> car = dict()
>
> inherit_from( counter_class, car )
>
> print( car[ "counter_value" ]() )
> car[ "counter_increment" ]()
> print( car[ "counter_value" ]() )
>
>   . The "create" part is simplified. I just wanted to show how
>   to make methods like "counter_increment" act on the object
>   that inherited them using "partial".

That's simple and interesting.  I'll study your more elaborate approach
next, but I like what I see already.  Thank you so much.
-- 
https://mail.python.org/mailman/listinfo/python-list


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<---cut here---end--->8---
>>Is there a way to do this with f-strings?
>
>   I cannot think of anything shorter now than:
>
> eval( 'f"The name is {name} and the email is {email}"', d )
>
>   , but with the spaces removed, it's even one character
>   shorter than the format expression:
>
> eval('f"The name is {name} and the email is {email}"',d)
> "The name is {name} and the email is {email}".format(**d)
>
>   . 

Lol.  That's brilliant!  Thanks very much!
-- 
https://mail.python.org/mailman/listinfo/python-list


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: 
>> > 
>> > eval('f"The name is {name} and the email is {email}"',d)
>> > "The name is {name} and the email is {email}".format(**d) 
>> 
>> Lol. That's brilliant! Thanks very much!
>
> Calling eval for that is like shooting a fly with a cannon.

Indeed!  But we're not looking for production-quality code.  Just an
extreme way to satisfy a silly requirement.

> Besides, this one is even shorter:
>
> f"The name is {d['name']} and the email is {d['email']}"

This doesn't quite satisfy the requeriments.  We're trying to specify
only the keys, not the dictionary.  (But maybe the requirements did not
say that explicitly.  I'd have to look it up again --- it's been
snipped.  It's not important.  Thanks much for your thoughts!)
-- 
https://mail.python.org/mailman/listinfo/python-list


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 h calling j which
returns True or False based on a random thing.  (This simulates a task
that sometimes succeeds and sometimes fails.)  If while at f() I want to
know what happened at j(), I'm going to have to propagate that
information upwards through the execution stack.  I can't do that right
now: I'd have to change f, g and h.

--8<---cut here---start->8---
from random import randint
  
def f():
  g()

def g():
  h()

def h():
  if j():
print("I got a 2.")
  else:
print("I got a 1.")

def j():
  return randint(1,2) == 2
--8<---cut here---end--->8---

If instead of that, j() would be raising an exception when it fails,
then all I only need to change f() to know what happens.

I could replace j's test with opening a file, say.  That would improve
it a little.  I'm sure you guys know excellent cases to show.  Would you
be so kind to share anything you might have in mind?
-- 
https://mail.python.org/mailman/listinfo/python-list


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: 
>> > 
>> >> > , but with the spaces removed, it's even one character 
>> >> > shorter than the format expression: 
>> >> > 
>> >> > eval('f"The name is {name} and the email is {email}"',d) 
>> >> > "The name is {name} and the email is {email}".format(**d) 
>> >> 
>> >> Lol. That's brilliant! Thanks very much! 
>> > 
>> > Calling eval for that is like shooting a fly with a cannon.
>> 
>> Indeed! But we're not looking for production-quality code. Just an 
>> extreme way to satisfy a silly requirement.
>
> Indeed, as far as programming goes, even the premise is
> totally nonsensical.  Maybe you too better go to the pub?

It surely isn't precise, but Stefan Ram caught my meaning.  It's hard to
be precise.  I wanted to avoid having to write things like d['key'].
Stefam Ram provided a solution.  I did not care whether it was something
sensible to do in Python from a serious-programming perspective.  Thank
you for thoughts anyhow.  I appreciate it.
-- 
https://mail.python.org/mailman/listinfo/python-list


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() and the
real job is done in does_a_job(), which, in turns, needs to delegate
tasks to those other procedures that fail sometimes.  

It's does_a_job() that /must/ distinguish the error codes because errors
come in as False from both opens_file() and reads_file().  So the checks
must be done both in does_a_job() and in main().  (We also notice that
does_a_job() has a return-type that's a union (sometimes an integer,
sometimes a string), which makes distinguishing error code and success a
bit harder.)

--8<---cut here---start->8---
from random import randint

def main():
  r, data = does_a_job()
  if r < 0:
if r == -1:
  print("Fatal. Could not open file.")
  return None
if r == -2:
  print("Fatal. Could not read file")
  return None
  print(f"Great! We got the data: ``{r}''.")

def does_a_job():
  okay = opens_file()
  if not okay:
return -1
  okay, data = reads_file()
  if not okay:
return -2
  closes_file()
  return data

def open_file(): # Opens okay with probability 80%
  return randint(1,10) <= 8

def read_file(): # Reads okay with probability 50%
  return randint(1,10) <= 5, "data I am"

def closes_file():  # Works with probability 1
  return True
--8<---cut here---end--->8---

If we could give the program a final destination at does_a_job(), the
job would be easier.  But all we want to do in does_a_job() is to
propagate the error conditions upwards to main() to really decide what
to do.  Exceptions lets us do that with a cleaner version.

--8<---cut here---start->8---
from random import randint

def main():
  try:
data = does_a_job()
  except FileNotFoundError:
print("Fatal. Could not open file.")
  except MemoryError:
print("Fatal. Could not read file")
  else:
print(f"Great! We got the data: ``{data}''.")

def does_a_job():
  open_file()
  data = reads_file()
  close_file()
  return data

def open_file(): # Opens okay with probability 80%
  if randint(1,10) <= 8:
return True
  raise FileNotFoundError("Sorry: the file system is /so/ busy right now.")

def reads_file(): # Reads okay with probability 50%
  if randint(1,10) <= 5:
return "data I am"
  raise MemoryError("Sorry: not enough memory for /all/ this data.")

def close_file():  # Works with probability 1
  return True
--8<---cut here---end--->8---
-- 
https://mail.python.org/mailman/listinfo/python-list


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 his ``C Unleashed'' once and I liked what I saw.)  This is how
I search for books --- I go through the authors first.  Charles Petzold,
for instance, anything he writes is worth reading it.  (Have you given
his Annotated Turing a shot?  It's a very nice read.)

So that's my request --- any author you find very good has written a
book on Python?

It could be for in a certain specific context.  For instance, I also
searched for Hadley Wickham in the hope that he could have written a
data-science-type of book using Python.  I like his writing a lot, but
he also only seems to have written only for the R language.

Thank you!
-- 
https://mail.python.org/mailman/listinfo/python-list


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 Python is looking really nice, actually.  It seems so concise,
so it looks like a really nice first read.  Thank you for the
recommendation.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: venv and packages with entry points

2022-09-06 Thread Calvin Spealman
Each virtual environment has its own bin/ directory and when activated its
bin/ is in your $PATH

On Tue, Sep 6, 2022 at 1:45 PM  wrote:

> Hello,
>
> I try to get it onto my head how virtual environments (via venv) works
> when I have packages with "entry points".
>
> I can define such entry points in the setup.cfg like this (full example
> [1]):
>
> [options.entry_points]
> console_scripts =
>  hyperorg = hyperorg.__main__:main
>
> When I install such a package via pip the result is a shell script in
> /usr/bin/...
>
> What happens when I install such a package with an entry point via "pip
> install ." when an virtual environment is activated?
>
> Kind
> Christian
>
> [1] --
> 
> --
> https://mail.python.org/mailman/listinfo/python-list
>
>

-- 

CALVIN SPEALMAN

SENIOR QUALITY ENGINEER

calvin.speal...@redhat.com  M: +1.336.210.5107
[image: https://red.ht/sig] 
TRIED. TESTED. TRUSTED. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: on str.format and f-strings

2022-09-06 Thread Chris Angelico
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 the introduction of f-strings: the PEP at
>
>   https://peps.python.org/pep-0498/#id11
>
> says so explicitly.

Precisely. It was never meant to obsolete str.format, and it does not.

> My question is whether f-strings can do the
> following nice thing with dictionaries that str.format can do:
>
> --8<---cut here---start->8---
> def f():
>   d = { "name": "Meredith", "email": "mmontgom...@levado.to" }
>   return "The name is {name} and the email is {email}".format(**d)
> --8<---cut here---end--->8---
>
> Is there a way to do this with f-strings?

No. That's not their job. That's str.format's job.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Python-announce] ANN: GF4 Now Has A Plugin Capability

2022-09-06 Thread Thomas Passin
A new plugin capability for the GF4 Waveform Calculator lets a Python 
file in the new plugins directory add a new command and command button. 
This is helpful for adding or developing new functionality.


Basic information for writing and using plugins is included in the 
README file in the plugins directory.


As always,the devel branch contains the most recent changes.

There is also a new recent_changes.md file in the project root.

GF4 is a Python program to display two-dimensional data, such as time 
series data, and to perform mathematical operations on the data or 
between two related data sets. The program aims to make data exploration 
easy and enjoyable.


The project is hosted on Github:

https://github.com/tbpassin/gf4-project/

--
https://mail.python.org/mailman/listinfo/python-list


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 the introduction of f-strings: the PEP at
>>
>>   https://peps.python.org/pep-0498/#id11
>>
>> says so explicitly.
>
> Precisely. It was never meant to obsolete str.format, and it does not.
>
>> My question is whether f-strings can do the
>> following nice thing with dictionaries that str.format can do:
>>
>> --8<---cut here---start->8---
>> def f():
>>   d = { "name": "Meredith", "email": "mmontgom...@levado.to" }
>>   return "The name is {name} and the email is {email}".format(**d)
>> --8<---cut here---end--->8---
>>
>> Is there a way to do this with f-strings?
>
> No. That's not their job. That's str.format's job.

Chris!  So good to see you around here again.  Thank you so much for
your input on this. 
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2022-09-06 Thread Thomas Passin
Mark Pilgram's "Dive Into Python" was good.  Now he's updated it for 
Python 3:


https://diveintopython3.net

On 9/6/2022 11:36 AM, Meredith Montgomery wrote:

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 Python is looking really nice, actually.  It seems so concise,
so it looks like a really nice first read.  Thank you for the
recommendation.


--
https://mail.python.org/mailman/listinfo/python-list


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

2022-09-06 Thread Louis Krupp

On 9/5/2022 8:22 PM, Meredith Montgomery wrote:

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 his ``C Unleashed'' once and I liked what I saw.)  This is how
I search for books --- I go through the authors first.  Charles Petzold,
for instance, anything he writes is worth reading it.  (Have you given
his Annotated Turing a shot?  It's a very nice read.)

So that's my request --- any author you find very good has written a
book on Python?

It could be for in a certain specific context.  For instance, I also
searched for Hadley Wickham in the hope that he could have written a
data-science-type of book using Python.  I like his writing a lot, but
he also only seems to have written only for the R language.

Thank you!


I liked _Introducing Python_ by Bill Lubanovic.

Louis
--
https://mail.python.org/mailman/listinfo/python-list


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

2022-09-06 Thread Peter J. Holzer
On 2022-09-05 23:22:34 -0300, Meredith Montgomery wrote:
> 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 his ``C Unleashed'' once and I liked what I saw.)  This is how
> I search for books --- I go through the authors first.

Unfortunately I can't help you (never read a book on Python myself), but
that seems like a weird way to search for a book on a language. I
woudn't expect a single author to be able to write good books on more
than a handful[1] of languages. Learning a language well takes time.
Learning it so well that you can teach it well takes even longer. So I'd
be quite ware of authors who write books on lots of different languages.

hp

[1] Possibly the hand of a carpenter.

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2022-09-06 Thread jkn
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 on Python? 
> > 
> > The ones by David Beazley are great. Same with his non-book writings 
> > about Python. See: http://dabeaz.com/
> Distilled Python is looking really nice, actually. It seems so concise, 
> so it looks like a really nice first read. Thank you for the 
> recommendation.

I concur with Paul's general recommendation of David Beazley's work.
I bought a copy of Python Distilled recently, having 'grown up' with editions
of his earlier 'Python Essential Reference', going back to the first edition
(Python 1.5?)

I confess to being slightly disappointed with 'Python Distilled', but I was
probably expecting something that I shouldn't have. It is basically a relatively
fast-paced introduction to 'modern' python, stripping down some of the fine
detail that the 'Essential Reference' books leave in.

I am not 100% sure how useful it would be for relative beginners; it depends 
what
you are looking for. As a reference to functions and library usage etc., the
essential reference books are (still) great, and cheap via eBay. As a stepping 
stone
from 'fluent beginner', it might well be perfect. As a hand-holding learning 
guide,
maybe not so great.

I'm by no means trying to diss Beazley's work, I think it is great; just trying 
to
indicate what you get for your money, and maybe the target audience.

J^n


-- 
https://mail.python.org/mailman/listinfo/python-list


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

2022-09-06 Thread jkn
On Tuesday, September 6, 2022 at 9:06:31 PM UTC+1, Thomas Passin wrote:
> Mark Pilgram's "Dive Into Python" was good. Now he's updated it for 
> Python 3: 

like, about ten years ago? (I think Mark Pilgrim dropped off the 'net
many years ago...)


> https://diveintopython3.net
> On 9/6/2022 11:36 AM, Meredith Montgomery wrote: 
> > 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 Python is looking really nice, actually. It seems so concise, 
> > so it looks like a really nice first read. Thank you for the 
> > recommendation.
-- 
https://mail.python.org/mailman/listinfo/python-list


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

2022-09-06 Thread avi.e.gross
Subject: searching for books by an author you like on rather unrelated
topics.

I am curious if you normally look or books by a writer of Mysteries you like
to see if they also wrote Science Fiction or Cookbooks and so on?

Having said that, there are plenty of people in the Computer Science field
who are quite multi-lingual and may know one or a few "languages" intimately
and quite a bit about others and at least have heard of many more. Most such
people never write a single book of the kind you are looking for.

However, once someone does write some introductory book on some language or
other system, sometimes with co-authors, some do indeed proceed to write
additional books albeit not always of high quality. I have seen people who
say were quite familiar with a language like C then turn around and try to
teach languages like Python or R with an emphasis on doing things using
similar methods like using explicit loops where others might use vectorized
operations or comprehensions. 

I think the method of selecting an author is a bit flawed as a concept but
not irrelevant. An author for an introductory textbook for non-programmers
might not do as well in another book about the same language made for
programmers who already can program in one or more other languages and
mainly want to know how this language differs from others. And certainly
they may not do well writing about more detailed or sophisticated aspects of
the language. But the opposite is true. Many "experts" are horrible at
explaining simpler things at the right level for newbies.

You, do sound like you know something about programming in one or more other
languages and simply want to add-on Python. There are quite a few books
available including some older and some recent. What you likely should
prioritize is newer books that focus over post-version2 as that is supposed
to no longer be used when possible. Then you need to figure out if you are
just curious or want a job using it and so on. 

One possibility is to visit a library (or online e-books) and flip through
pages. Often you may find an earlier edition and after some perusal,
consider getting an updated recent version of that book by the same author.

I have read dozens of books on Python but leave recommendations to others as
each is different and I wanted to see many sides.

-Original Message-
From: Python-list  On
Behalf Of Meredith Montgomery
Sent: Monday, September 5, 2022 10:23 PM
To: python-list@python.org
Subject: any author you find very good has written a book on Python?

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 his ``C Unleashed'' once and I liked what I saw.)  This is how I search
for books --- I go through the authors first.  Charles Petzold, for
instance, anything he writes is worth reading it.  (Have you given his
Annotated Turing a shot?  It's a very nice read.)

So that's my request --- any author you find very good has written a book on
Python?

It could be for in a certain specific context.  For instance, I also
searched for Hadley Wickham in the hope that he could have written a
data-science-type of book using Python.  I like his writing a lot, but he
also only seems to have written only for the R language.

Thank you!
--
https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


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

2022-09-06 Thread Thomas Passin

On 9/6/2022 5:10 PM, jkn wrote:

On Tuesday, September 6, 2022 at 9:06:31 PM UTC+1, Thomas Passin wrote:

Mark Pilgram's "Dive Into Python" was good. Now he's updated it for
Python 3:


like, about ten years ago? (I think Mark Pilgrim dropped off the 'net
many years ago...)


Yes, I thought so too, but I just found the website and it's operating. 
Could be for all I know that the Python3 version is ten years old, but 
the book should still be worthwhile.





https://diveintopython3.net
On 9/6/2022 11:36 AM, Meredith Montgomery wrote:

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 Python is looking really nice, actually. It seems so concise,
so it looks like a really nice first read. Thank you for the
recommendation.


--
https://mail.python.org/mailman/listinfo/python-list


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

2022-09-06 Thread Dennis Lee Bieber
On Mon, 05 Sep 2022 23:22:34 -0300, Meredith Montgomery
 declaimed the following:

>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

So far as I know, Petzold is a Windows Internals type person. Python is
not a M$ product (even if they stuff it into their Win10 "app store" and is
an option in Visual Studio.

Searching for Python books using authors that may or may not have ever
seen Python seems futile... Many of my Python books are O'Reilly
publications, with specialized books from Packt and APress.


-- 
Wulfraed Dennis Lee Bieber AF6VN
wlfr...@ix.netcom.comhttp://wlfraed.microdiversity.freeddns.org/
-- 
https://mail.python.org/mailman/listinfo/python-list