Re: creating raw AWS log event

2021-06-23 Thread Larry Martell
On Wed, Jun 23, 2021 at 7:05 PM Dennis Lee Bieber wrote: > > On Wed, 23 Jun 2021 10:42:42 -0700, Larry Martell > declaimed the following: > > >def _decode(data): > >compressed_payload = b64decode(data) > >json_payload = zlib.decompress(compressed_payload, 16+zlib.MAX_WBITS) > >return

RE: Optimizing Small Python Code

2021-06-23 Thread Avi Gross via Python-list
Yes, I agree that if you do not need to show your work to a human, then the problem specified could be solved beforeand and a simple print statement would suffice. Ideally you want to make a problem harder such as by specifying an N that varies then testing it with an arbitrary N. But I suggest t

Re: Uninstall and Re-install Python - Windows 10 issues

2021-06-23 Thread Mats Wichmann
On 6/23/21 6:47 AM, Suretha Weweje wrote: After I uninstalled Python 3.7and Python 3.9 and installed Python 3.9.5 and is displayed in Apps & features: Python 3.9.5 Python 3.9.5 (64-bit), size 101 MB, and Python Launcher, size 1.80 MB Upon checking the python version, I get the following error m

Re: Uninstall and Re-install Python - Windows 10 issues

2021-06-23 Thread boB Stepp
Disclaimer: I am no Python or programming expert! However, I recently installed Python 3.9.5 on my Windows 10 laptop, so I may be able to help with some things. On Wed, Jun 23, 2021 at 11:29 AM Suretha Weweje wrote: > > After I uninstalled Python 3.7and Python 3.9 and installed Python 3.9.5 and

creating raw AWS log event

2021-06-23 Thread Larry Martell
When an AWS cloudwatch event is passed to a consumer it looks like this: { "awslogs": { "data": "ewogICAgIm1l..." } } To get the actual message I do this: def _decode(data): compressed_payload = b64decode(data) json_payload = zlib.decompress(compressed_payload, 16+zlib.

Re: Python-list Digest, Vol 213, Issue 24

2021-06-23 Thread Ayaana Soni
Thank you it worked using the code you gave!!! On Tue, Jun 22, 2021 at 9:33 PM wrote: > Send Python-list mailing list submissions to > python-list@python.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.python.org/mailman/listinfo/python-list > or,

Uninstall and Re-install Python - Windows 10 issues

2021-06-23 Thread Suretha Weweje
After I uninstalled Python 3.7and Python 3.9 and installed Python 3.9.5 and is displayed in Apps & features: Python 3.9.5 Python 3.9.5 (64-bit), size 101 MB, and Python Launcher, size 1.80 MB Upon checking the python version, I get the following error message: C:\>python --version Python was not

Re: Optimizing Small Python Code

2021-06-23 Thread Michael F. Stemper
On 23/06/2021 08.17, Stefan Ram wrote: "Avi Gross" writes: This can be made a one-liner too! LOL! print( '1\n 0\n2\n 0\n 1\n3\n 0\n 1\n 2\n4\n 0\n 1\n 2\n 3\n5\n 0\n 1\n 2\n 3\n 4\n6\n 0\n 1\n 2\n

Re: Optimizing Small Python Code

2021-06-23 Thread Dieter Maurer
Kais Ayadi wrote at 2021-6-22 08:03 -0700: >Hi There! >this is a small python code executed in 61 steps > >for n in range(1, 7): >print (n) >for x in range(0, n): >print(" ", x) > >can this code be more optimised? You should proceed as follows: implement a task in the most stra