Re: on perhaps unloading modules?

2021-08-23 Thread Hope Rouselle
Dennis Lee Bieber  writes:

> On Sat, 21 Aug 2021 17:15:14 -0300, Hope Rouselle 
> declaimed the following:
>
>>write some PHP precisely because it looked so much more cryptic than
>>Allaire ColdFusion.  Then C looked even more cryptic, so I fell in love
>>with C.
>>
>   Try APL then...

Lol.  If the code below is APL, then thanks, but no, thanks. :-) We
change over the years.  These days I'm more or less obsessed with
clarity.  For instance, I'm a lot into literate programming Knuth-style.

I have a certain distaste for syntax too.  For instance, I would much
rather write and read ``first(ls)'' than ``ls[0]''.  I can't see too
much advantage in using more syntax for something that procedures could
do.  But, of course, in certain contexts it might be better to write
ls[0] or something like that.  In these cases, the writer could then
make the case and then define the new syntax, so I do think that writers
should have the power to change syntax.

I'm well aware of the double-edged sword this is.  (Incidentally,
yesterday I was happily reading a Python programmer talking about [1]
how Dijkstra got it right for suggesting we shouldn't be using goto.
Knuth had the opinion that it'd be a shame to remove goto, even though,
of course, he'd agree that people should learn how to use it.)

Is syntax the same thing as goto?  I'm not sure.  If it is, then I am
like Knuth --- I feel sad when languages remove my ability to change
syntax.  But surely I feel overwhelmed sometimes when there's too much
syntax created by the programmer who wrote the library that I'm trying
to understand.

(*) Footnotes

[1] Notes on structured concurrency
https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful

> (I suspect this will get garbaged in processing...)
>
>   4 5 ? 20 ? 52
>
> (it did... the first ? [in my display] is Greek lower case rho, the second
> question mark is... a question mark).

Like you, I see two question marks.

>   4 5 $RHO 20 ? 52
>
>   Generate 20 random numbers in the range 1..52, no duplicates, reshape
> the vector into a 4x5 matrix.
>
>   That just "dealt" four poker hands (needs logic to translate integer
> 1..52 into suit/rank).

That's wild. :-) Was this created by Brian Kernighan?  It's hard to
believe.  Oh, I think he wrote AMPL, wasn't it?  A Mathematical
Programming Language, or something like that.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Making command-line args available to deeply-nested functions

2021-08-23 Thread Loris Bennett
George Fischhof  writes:

> Loris Bennett  ezt írta (időpont: 2021. aug.
> 20., P 17:54):
>
>> Julio Di Egidio  writes:
>>
>> > On Friday, 20 August 2021 at 11:54:00 UTC+2, Loris Bennett wrote:
>> >> Hi,
>> >>
>> >> TL;DR:
>> >>
>> >> If I have a command-line argument for a program, what is the best way
>> >> of making this available to a deeply-nested[1] function call without
>> >> passing the parameter through every intermediate function?
>> >
>> > To not pass arguments you need shared state ("global variables"): and
>> > options in shard state, unless you have very good reasons to do
>> > otherwise, is simply a no no.
>>
>> Doesn't that slightly depend on the size of your "globe"?  If a program
>> does a few, in some sense unrelated things, and, say, only runs for a
>> few minutes, could you not decide to make a particular parameter global,
>> even though only one function needs it?  In general, however, I would
>> also avoid this.
>>
>> > 
>> >> I can see that the top-level could just create an object from a class
>> >> which encapsulates everything, but what if I want to keep the salutation
>> >> generation separate, so that I can have a separate program which just
>> >> generates the salutation and print it to the terminal?
>> >
>> > Yes, that's basically the way to go: parse arguments into a structure (an
>> > object) that contains all options/parameters then pass that down.  Next
>> level:
>> > some sections of your code may require a certain subset of those
>> options, some
>> > may require some other, so you would structure your options object in
>> > sub-objects for the various sets of correlated options, then rather pass
>> just
>> > the sub-object(s) that are relevant to the section of code you are
>> calling.
>> > Variations are of course possible, anyway that's the basic idea.
>> >
>> > Also have a look at the "argparse" library, it does all the heavy
>> lifting for
>> > the parsing and creation of those objects, definitely advised for in non
>> trivial
>> > cases: .
>>
>> I am already using 'argparse' ('configargparse' actually).  What aspect
>> should I be looking at in order to produce "sub-objects"?
>>
>> >> I guess I am really asking how to avoid "passing through" arguments to
>> >> functions which only need them to call other functions, so maybe the
>> >> answer is just to avoid nesting.
>> >
>> > No, you don't get rid of code structure just not to pass arguments to
>> > a function...  Code may be poorly structured, but that's another
>> > story.
>>
>> As I am writing new code it is more a question of imposing structure,
>> rather than getting rid of structure.  Unwritten code for a given
>> purpose obviously has some sort of structure with regards to, say, loops
>> and conditions, but I am less sure about the implications for how the
>> code should be nested.  Another argument against deeply-nested functions
>> is the increased complexity of testing.

[snip (15 lines)]>

> Hi,
>
> Also you can give a try to click and / or  typer packages.
> Putting args into environment variables can be a solution too
> All of these depends on several things: personal preferences, colleagues /
> firm standards, the program, readability, variable accessibility (IDE
> support, auto completition) (env vars not supported by IDEs as they are not
> part of code)

Thanks for the pointers, although I have only just got my head around
argparse/configargparse, so click is something I might have a look at
for future project.

However, the question of how to parse the arguments is somewhat separate
from that of how to pass (or not pass) the arguments around within a
program.

Cheers,

Loris

-- 
This signature is currently under construction.
-- 
https://mail.python.org/mailman/listinfo/python-list


Decoding of EmailMessage text

2021-08-23 Thread Loris Bennett
Hi,

I have written a command-line program to send email using

  from email.message import EmailMessage

which has an option '--verbose' which prints the email via

  if args.verbose:
  print(f"{mail.as_string()}")   

If I run this with

  $ poetry run send_email loris -l en -s "Another test" -t 
~/tmp/blorp_bleep.txt --verbose

the following is printed to the terminal:

  Content-Type: text/plain; charset="utf-8"
  Content-Transfer-Encoding: base64
  MIME-Version: 1.0
  From: [email protected]
  To: [email protected]
  Subject: Another test

  RGVhciBEci4gQmVubmV0dCwKCkJsb3JwISBCbGVlcCEKCgotLQpNYWlsYm90IEluYy4KMDEwMTAx  
 │
  IEJvdCBCb3VsZXZhcmQKQm90aGFtIENpdHkKQsO2dGxhbmQK

However I would like to see the text as

  Dear Dr. Bennett,

  Blorp! Bleep!
  
  Regards,

  Mailbot

  --
  Mailbot Inc.
  010101 Bot Boulevard
  Botham City
  Bötland
  
which is how the text appears in the mail.

The 'ö' in 'Bötland' triggers the encoding - with 'Botland' the text
printed to the terminal is the same way as that in the mail.

How do I decode the message properly for an terminal which uss UTF-8?

Regards

Loris

-- 
This signature is currently under construction.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Decoding of EmailMessage text

2021-08-23 Thread Jon Ribbens via Python-list
On 2021-08-23, Loris Bennett  wrote:
> If instead of 
>
>   mail.set_content(body)
>
> I do 
>
>   mail.set_content(body, cte="quoted-printable")

Try print(mail.get_content()) rather than print(mail.as_string())
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Decoding of EmailMessage text

2021-08-23 Thread Loris Bennett
"Loris Bennett"  writes:

> Hi,
>
> I have written a command-line program to send email using
>
>   from email.message import EmailMessage
>
> which has an option '--verbose' which prints the email via
>
>   if args.verbose:
>   print(f"{mail.as_string()}")   
>
> If I run this with
>
>   $ poetry run send_email loris -l en -s "Another test" -t 
> ~/tmp/blorp_bleep.txt --verbose
>
> the following is printed to the terminal:
>
>   Content-Type: text/plain; charset="utf-8"
>   Content-Transfer-Encoding: base64
>   MIME-Version: 1.0
>   From: [email protected]
>   To: [email protected]
>   Subject: Another test
>
>   
> RGVhciBEci4gQmVubmV0dCwKCkJsb3JwISBCbGVlcCEKCgotLQpNYWlsYm90IEluYy4KMDEwMTAx  
>  │
>   IEJvdCBCb3VsZXZhcmQKQm90aGFtIENpdHkKQsO2dGxhbmQK
>
> However I would like to see the text as
>
>   Dear Dr. Bennett,
>
>   Blorp! Bleep!
>   
>   Regards,
>
>   Mailbot
>
>   --
>   Mailbot Inc.
>   010101 Bot Boulevard
>   Botham City
>   Bötland
>   
> which is how the text appears in the mail.
>
> The 'ö' in 'Bötland' triggers the encoding - with 'Botland' the text
> printed to the terminal is the same way as that in the mail.
>
> How do I decode the message properly for an terminal which uss UTF-8?

If I do 

From: "Loris Bennett" 
Newsgroups: comp.lang.python
Subject: Re: Decoding of EmailMessage text
Gcc: "nnimap+fu_exchange:Gesendete Elemente"
--text follows this line--
"Loris Bennett"  writes:

> Hi,
>
> I have written a command-line program to send email using
>
>   from email.message import EmailMessage
>
> which has an option '--verbose' which prints the email via
>
>   if args.verbose:
>   print(f"{mail.as_string()}")   
>
> If I run this with
>
>   $ poetry run send_email loris -l en -s "Another test" -t 
> ~/tmp/blorp_bleep.txt --verbose
>
> the following is printed to the terminal:
>
>   Content-Type: text/plain; charset="utf-8"
>   Content-Transfer-Encoding: base64
>   MIME-Version: 1.0
>   From: [email protected]
>   To: [email protected]
>   Subject: Another test
>
>   
> RGVhciBEci4gQmVubmV0dCwKCkJsb3JwISBCbGVlcCEKCgotLQpNYWlsYm90IEluYy4KMDEwMTAx  
>  │
>   IEJvdCBCb3VsZXZhcmQKQm90aGFtIENpdHkKQsO2dGxhbmQK
>
> However I would like to see the text as
>
>   Dear Dr. Bennett,
>
>   Blorp! Bleep!
>   
>   Regards,
>
>   Mailbot
>
>   --
>   Mailbot Inc.
>   010101 Bot Boulevard
>   Botham City
>   Bötland
>   
> which is how the text appears in the mail.
>
> The 'ö' in 'Bötland' triggers the encoding - with 'Botland' the text
> printed to the terminal is the same way as that in the mail.
>
> How do I decode the message properly for an terminal which uss UTF-8?

If I do 

From: "Loris Bennett" 
Newsgroups: comp.lang.python
Subject: Re: Decoding of EmailMessage text
Gcc: "nnimap+fu_exchange:Gesendete Elemente"
--text follows this line--
"Loris Bennett"  writes:

> Hi,
>
> I have written a command-line program to send email using
>
>   from email.message import EmailMessage
>
> which has an option '--verbose' which prints the email via
>
>   if args.verbose:
>   print(f"{mail.as_string()}")   
>
> If I run this with
>
>   $ poetry run send_email loris -l en -s "Another test" -t 
> ~/tmp/blorp_bleep.txt --verbose
>
> the following is printed to the terminal:
>
>   Content-Type: text/plain; charset="utf-8"
>   Content-Transfer-Encoding: base64
>   MIME-Version: 1.0
>   From: [email protected]
>   To: [email protected]
>   Subject: Another test
>
>   
> RGVhciBEci4gQmVubmV0dCwKCkJsb3JwISBCbGVlcCEKCgotLQpNYWlsYm90IEluYy4KMDEwMTAx  
>  │
>   IEJvdCBCb3VsZXZhcmQKQm90aGFtIENpdHkKQsO2dGxhbmQK
>
> However I would like to see the text as
>
>   Dear Dr. Bennett,
>
>   Blorp! Bleep!
>   
>   Regards,
>
>   Mailbot
>
>   --
>   Mailbot Inc.
>   010101 Bot Boulevard
>   Botham City
>   Bötland
>   
> which is how the text appears in the mail.
>
> The 'ö' in 'Bötland' triggers the encoding - with 'Botland' the text
> printed to the terminal is the same way as that in the mail.
>
> How do I decode the message properly for an terminal which uss UTF-8?

If instead of 

  mail.set_content(body)

I do 

  mail.set_content(body, cte="quoted-printable")

then I get 

  Dear Dr. Bennett,

  Blorp! Bleep!


  --
  Mailbot Inc.
  010101 Bot Boulevard
  Botham City
  B=C3=B6tland

That a bit better, but still not what I want since the main text could
also be in German and thus also contain umlauts, etc.

Cheers,

Loris

-- 
This signature is currently under construction.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Decoding of EmailMessage text

2021-08-23 Thread Loris Bennett
Jon Ribbens  writes:

> On 2021-08-23, Loris Bennett  wrote:
>> If instead of 
>>
>>   mail.set_content(body)
>>
>> I do 
>>
>>   mail.set_content(body, cte="quoted-printable")
>
> Try print(mail.get_content()) rather than print(mail.as_string())

That did the trick - thanks!

Cheers,

Loris

-- 
This signature is currently under construction.
-- 
https://mail.python.org/mailman/listinfo/python-list


Why Pyto package not available yet ???

2021-08-23 Thread Steeve Kerou via Python-list

Hi, 




 
Here is Pyto, the first animated character that help you Learn Python like you 
play video games Why not implement me on Python PyPI ???



Episode 1: Intro / Who is Pyto ? / The Idle World | Pytorial


| 
| 
| 
|  |  |

 |

 |
| 
|  | 
Episode 1: Intro / Who is Pyto ? / The Idle World | Pytorial


 |

 |

 |




Alan V.

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


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

2021-08-23 Thread Mostowski Collapse

The world is getting ridiculous. termux seems to
not anymore be supported by Google Play because
of some Android 10 issues?

On the other hand there is this gem:

TI 84 Plus CE Python Edition Unboxing
https://www.youtube.com/watch?v=LVxP_Fki8Fc

LoL

Mostowski Collapse schrieb:

Yesterday we went into a little programming binge, despite there
was a free parade in Zurich. We could now already implement a transpiler
that targets Python. We simply took the transpiler main.p that targets

JavaScript and moded it into a new transpiler mainpy.p that targets
Python. The code is already on GitHub and we present it also here
as the Python code mainpy.p. We were also busy

on machine.py and special.py. The progress is now:

++   cross  +-+
| loader.p   |   compile    | loader.py   | 100%
| compiler.p | ---> | compiler.py | 100%
++  +-+
     | machine.py  |  66%
     | special.py  |  33%
     +-+

See also:

Python Version of Dogelog Runtime special
https://twitter.com/dogelogch/status/1426884473988292617

Python Version of Dogelog Runtime special
https://www.facebook.com/groups/dogelog


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


Re: on perhaps unloading modules?

2021-08-23 Thread Dennis Lee Bieber
On Sun, 22 Aug 2021 16:28:12 -0300, Hope Rouselle 
declaimed the following:


>That's wild. :-) Was this created by Brian Kernighan?  It's hard to
>believe.  Oh, I think he wrote AMPL, wasn't it?  A Mathematical
>Programming Language, or something like that.

Kenneth Iverson, early 1960s for release, though he started in the late
50s (so a decade before Kernighan). I believe it started life as a notation
for publishing reports, not as an actual implemented language.


{Hmmm, supposed to have influenced Matlab, S, and Wolfram/Mathematica}

One of the quirks is that one reads APL from right to left... cf:


You do not want to look down at the one-liner for Conway's Game of
Life.


-- 
Wulfraed Dennis Lee Bieber AF6VN
[email protected]://wlfraed.microdiversity.freeddns.org/

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


Re: Making command-line args available to deeply-nested functions

2021-08-23 Thread George Fischhof
Loris Bennett  ezt írta (időpont: 2021. aug.
23., H 19:26):

> George Fischhof  writes:
>
> > Loris Bennett  ezt írta (időpont: 2021. aug.
> > 20., P 17:54):
> >
> >> Julio Di Egidio  writes:
> >>
> >> > On Friday, 20 August 2021 at 11:54:00 UTC+2, Loris Bennett wrote:
> >> >> Hi,
> >> >>
> >> >> TL;DR:
> >> >>
> >> >> If I have a command-line argument for a program, what is the best way
> >> >> of making this available to a deeply-nested[1] function call without
> >> >> passing the parameter through every intermediate function?
> >> >
> >> > To not pass arguments you need shared state ("global variables"): and
> >> > options in shard state, unless you have very good reasons to do
> >> > otherwise, is simply a no no.
> >>
> >> Doesn't that slightly depend on the size of your "globe"?  If a program
> >> does a few, in some sense unrelated things, and, say, only runs for a
> >> few minutes, could you not decide to make a particular parameter global,
> >> even though only one function needs it?  In general, however, I would
> >> also avoid this.
> >>
> >> > 
> >> >> I can see that the top-level could just create an object from a class
> >> >> which encapsulates everything, but what if I want to keep the
> salutation
> >> >> generation separate, so that I can have a separate program which just
> >> >> generates the salutation and print it to the terminal?
> >> >
> >> > Yes, that's basically the way to go: parse arguments into a structure
> (an
> >> > object) that contains all options/parameters then pass that down.
> Next
> >> level:
> >> > some sections of your code may require a certain subset of those
> >> options, some
> >> > may require some other, so you would structure your options object in
> >> > sub-objects for the various sets of correlated options, then rather
> pass
> >> just
> >> > the sub-object(s) that are relevant to the section of code you are
> >> calling.
> >> > Variations are of course possible, anyway that's the basic idea.
> >> >
> >> > Also have a look at the "argparse" library, it does all the heavy
> >> lifting for
> >> > the parsing and creation of those objects, definitely advised for in
> non
> >> trivial
> >> > cases: .
> >>
> >> I am already using 'argparse' ('configargparse' actually).  What aspect
> >> should I be looking at in order to produce "sub-objects"?
> >>
> >> >> I guess I am really asking how to avoid "passing through" arguments
> to
> >> >> functions which only need them to call other functions, so maybe the
> >> >> answer is just to avoid nesting.
> >> >
> >> > No, you don't get rid of code structure just not to pass arguments to
> >> > a function...  Code may be poorly structured, but that's another
> >> > story.
> >>
> >> As I am writing new code it is more a question of imposing structure,
> >> rather than getting rid of structure.  Unwritten code for a given
> >> purpose obviously has some sort of structure with regards to, say, loops
> >> and conditions, but I am less sure about the implications for how the
> >> code should be nested.  Another argument against deeply-nested functions
> >> is the increased complexity of testing.
>
> [snip (15 lines)]>
>
> > Hi,
> >
> > Also you can give a try to click and / or  typer packages.
> > Putting args into environment variables can be a solution too
> > All of these depends on several things: personal preferences, colleagues
> /
> > firm standards, the program, readability, variable accessibility (IDE
> > support, auto completition) (env vars not supported by IDEs as they are
> not
> > part of code)
>
> Thanks for the pointers, although I have only just got my head around
> argparse/configargparse, so click is something I might have a look at
> for future project.
>
> However, the question of how to parse the arguments is somewhat separate
> from that of how to pass (or not pass) the arguments around within a
> program.
>
> Cheers,
>
> Loris
>
> --
> This signature is currently under construction.
> --
> https://mail.python.org/mailman/listinfo/python-list
>

>
>
>



Hi,
I thought not just parsing, but the usage method: you add a decorator to
the function where you want to use the parameters. This way you do not have
to pass the value through the calling hierarchy.

Note: typer is a newer package, it contains click and leverages command
line parsing even more.


BR,
George
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PyQt5 is not recognized from python 3.8 installation in python 3.10

2021-08-23 Thread Barry


> On 23 Aug 2021, at 00:00, Mats Wichmann  wrote:
> 
> On 8/22/21 7:04 AM, Mohsen Owzar wrote:
>> Hi guys,
>> I have on my laptop the python installation 3.8 and newly I installed newest 
>> version 3.10 as well on my laptop.
>> Now I have two IDLEs for both of the installations.
>> When I rund some *.py file, having PyQt5 module, on the 3.8 version, it 
>> works as before without any problems.
>> But whenn I run the same file on IDLE with 3.10 installation, it crashes and 
>> says that PyQt5 is not known.
>> I tried to install this package with"pip install pyqt5" or with "py -3 -m 
>> pip install pyqt5", it brings lots of error messages (long long) as the 
>> lines below (they are only the beginning of the messages):
> 
> make sure you're getting the right Python by doing
> 
> py -3.10 -m pip install pyqt5
> 
> (the fact you're getting the build error below indicates you _are_ getting 
> the right one, but it's good to be explicit anyway, just so you're sure).
> 
>> ==
>> C:\Users\Mohsen>py -3 -m pip install pyqt5
>> Collecting pyqt5
>>   Using cached PyQt5-5.15.4.tar.gz (3.3 MB)
>>   Installing build dependencies ... done
>>   Getting requirements to build wheel ... done
>> Preparing wheel metadata ... error
>> ERROR: Command errored out with exit status 1:
>>  command: 
>> 'C:\Users\Mohsen\AppData\Local\Programs\Python\Python310\python.exe' 
>> 'C:\Users\Mohsen\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py'
>>  prepare_metadata_for_build_wheel 
>> 'C:\Users\Mohsen\AppData\Local\Temp\tmprax0esmt'
>>  cwd: 
>> C:\Users\Mohsen\AppData\Local\Temp\pip-install-wl_b58e9\pyqt5_1cbd1bab46fa4abaad34b55514561ce6
>> Complete output (33 lines):
>> Querying qmake about your Qt installation...
>> C:\Qt\4.7.4\bin\qmake.exe -query
>> Traceback (most recent call last):
>>   File 
>> "C:\Users\Mohsen\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py",
>>  line 143, in prepare_metadata_for_build_wheel
>> hook = backend.prepare_metadata_for_build_wheel
>> AttributeError: module 'sipbuild.api' has no attribute 
>> 'prepare_metadata_for_build_wheel'
> 
> Your problem here is that there's no released binary wheel for PyQt5, since 
> Py 3.10 isn't released (there's been some recent chatter about encouraging 
> projects to make builds for new Python versions available early, e.g. once a 
> Python version hits release candidate state, but that's just that - chatter - 
> for now).
> 
> In theory your system should be able to build it, but my experience is that 
> unless you're an active Python developer on Windows and already have the 
> right working setup, it pretty much always fails.  These are the perils of 
> trying to use a pre-release...
> 
> That error suggests there's something different going on than usual (which 
> has to do with the MSVC compiler suite not being set up the way the package 
> expects): there looks like a version mismatch - it looks like it's finding 
> qmake for Qt4, not Qt5.  Maybe you can make some progress by adjusting some 
> paths?

Only trivial C code extensions can be built on windows.
And then only if you have the right MSVC tools installed.
Most interesting extensions have dependencies only other software.
Which means that you need to know how to build all the dependencies as well.

For something as complex as PyQt5 you need to be a developer with reasonable 
experience to build it.

Check on PyPI for the available versions and install one of them.

Barry



> 
> Many people go here to get early-access, albeit unofficial, binary wheels:
> 
> https://www.lfd.uci.edu/~gohlke/pythonlibs
> 
> Unfortunately, PyQt5 is not available from there (as listed in the section at 
> the very bottom)
> 
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

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


Re: Decoding of EmailMessage text

2021-08-23 Thread jak

Il 23/08/2021 13:12, Loris Bennett ha scritto:

Jon Ribbens  writes:


On 2021-08-23, Loris Bennett  wrote:

If instead of

   mail.set_content(body)

I do

   mail.set_content(body, cte="quoted-printable")


Try print(mail.get_content()) rather than print(mail.as_string())


That did the trick - thanks!

Cheers,

Loris




If you also want to know about the text, then that is probably utf8
encoded and converted to base64:

from base64 import b64decode

coded=(b'RGVhciBEci4gQmVubmV0dCwKCkJsb3JwISBCbGVlcCEKCgotLQpNYWlsYm90IEl'
   b'uYy4KMDEwMTAxIEJvdCBCb3VsZXZhcmQKQm90aGFtIENpdHkKQsO2dGxhbmQK')

uncoded = b64decode(coded).decode('utf8')
print(uncoded)

output:

Dear Dr. Bennett,

Blorp! Bleep!


--
Mailbot Inc.
010101 Bot Boulevard
Botham City
Bötland
--
https://mail.python.org/mailman/listinfo/python-list