Urgent

2020-07-13 Thread Damilare


I need help, am trying to activate python 3.8 on command prompt with Windows 10 
but it’s proving rather difficult. I will appreciate any help. Thanks

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


Re: Friday Finking: Limiting parameters

2020-07-13 Thread Barry Scott



> On 13 Jul 2020, at 06:21, dn via Python-list  wrote:
> 
> On 12/07/20 10:10 PM, Barry Scott wrote:
>>> On 12 Jul 2020, at 00:15, DL Neil via Python-list >> > wrote:
>>> 
 That does not necessarily mean that the function needs to know
 the particular representation or form of that data.   Let those be
 objects with getter methods for the data you wish, and have the
 function document what methods it will attempt to call.   Then
 any class that provides the expected methods would be suitable.
>>> 
>>> +1
>>> 
>>> Here, the proposal is not to pass an object per-se, but to pass a 
>>> function/method ("getter method") which will deliver the requisite 
>>> data-items?
>>> 
>>> So, might we then find that our mailing-label routine includes something 
>>> like (copy-pasting is NOT proper Python!):
>>> 
>>> def mail_label( getter ):
>>>...
>>>( first name, middle initial, last name, house number, street name,
>>>apartment number, town, state, country, zip code ) = getter()
>>> 
>>> In which case, have we not moved the "very long list" from the function def 
>>> to a later line within the routine - and how is this in some way 'better'?
>>> 
>> This is not the refactor that Roger's excellent rule-of-thumb implies.
>> Clearly moving the 20 positional args into a tuple is basically the same 
>> code,
>> and the same maintenance problem.
> 
> Agreed!
> 
> 
>> I'd expect to see something like this:
>> def mail_label( person, address ):
>> first_name = person.first_name
>> # or if you want a function interface
>> first_line_of_address = address.get_first_line()
> 
> Does this idea move whole objects across the interface? (see earlier in the 
> thread) Taking a person class as subject and a mailing-label as the 
> function's object, aren't there two criticisms?
> 
> 1 the function needs to know which attributes of the person and address 
> objects it wants to use, cf saying 'I need street, number, town, ...'*

That is part of the requirements spec for the function - the function author 
will implement against spec so will know what is needed.

> 
> 2 "person" likely contains a load of data that is irrelevant to printing a 
> mail-label.

The design problem we are solving is that it is easy (more maintainable) to 
call the function with a small number of args that provide what is needed.
Having access to more than the minimum information is not a problem usually.

One function might only need the family-name, another function the given-name 
(choose terms that match your region and culture here).

> 
> Why is this preferable to using a 'getter' method, or some other approach?

The idea of getter methods is to hide the implementation details of an object 
that may compute a value.
This is useful when refactoring and debugging, but can be over complex for a 
simple app/object.

person.get_name_formal() vs. person.get_name_informal() could use the same
set of data combined in different ways.

> 
> * your point (above) being that these need not be (say) a dozen data 
> elements, but could be just-enough data, and data-combinations which identify 
> the addressee and which represent the components of the address.

The app designer will have to design the API to person and address that makes 
sense in the app.

Barry

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


Re: frozendict: an experiment

2020-07-13 Thread Barry Scott



> On 13 Jul 2020, at 03:20, Marco Sulla  wrote:
> 
> TL;DR: I tried to implement in CPython a frozendict here:
> https://github.com/Marco-Sulla/cpython
> 
> Long explaining:
> 
> What is a frozendict? It's an immutable dict. The type was proposed in
> the past but rejected: https://www.python.org/dev/peps/pep-0416/
> 
> So why did I try to implement it? IMO, apart the considerations in PEP
> 416, a frozendict can be useful:
> 
> - as a faster base for types.MutableMappingProxy
> - as a substitute of namedtuple
> - as set values
> - as a faster dict. Indeed a frozendict does not need views. Keys,
> values and items can be cached and could be a subclass of frozendict
> that implements also the set API (values apart).


Why is it faster? Have you benchmarked that claim?

Why do you think I do not need views to use the frozendict?
I thought that is what make d.key(), d.items() etc work?

> 
> A possible problem is that frozendict requires more memory, since the
> hash is cached.

The hash is tiny 64 bits?

> 
> My implementation is very naif. I tried to do the simplest thing,
> without any speed improvement. I haven't added frozendict in marshal,
> and the pickle implementation is very raw... Furthermore, I didn't
> touch the AST parser at all, and I did not add any test for Python or
> the C API in the battery, but I've done my tests apart, in pytest.
> 
> PS: I used for tests and benchmarks a little modified version of the
> tests for my Python implementation of frozendict:
> https://github.com/Marco-Sulla/python-frozendict/tree/master/test .
> The results are interesting. A CPython builtin frozendict is faster in
> every bench that immutables.Map, that uses the HAMT algorithm. and was
> proposed as alternative in PEP 603:
> https://www.python.org/dev/peps/pep-0603/ . Maybe because I
> implemented it in CPython and immutables.Map is a C extension.
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

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


Re: Urgent

2020-07-13 Thread MRAB

On 2020-07-13 17:08, Damilare wrote:



I need help, am trying to activate python 3.8 on command prompt with Windows 10 
but it’s proving rather difficult. I will appreciate any help. Thanks


Why is it difficult?

(Why doesn't the subject give a clue as to the topic of the post?)

If it's saying that it can't find python.exe, try starting it with the 
Python launcher "py".

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


[RELEASE] Python 3.8.4 is now available

2020-07-13 Thread Łukasz Langa
Python 3.8.4 is the fourth maintenance release of Python 3.8. Go get it here:

https://www.python.org/downloads/release/python-384/ 

Maintenance releases for the 3.8 series will continue at regular bi-monthly 
intervals, with 3.8.5 planned for mid-September 2020.

What’s new?

The Python 3.8 series is the newest feature release of the Python language, and 
it contains many new features and optimizations. See the “What’s New in Python 
3.8 ” document for more 
information about features included in the 3.8 series.

This is the first bugfix release that is considerably smaller than the previous 
three. There’s almost 20% fewer changes at 162 commits than the average of 
previous three bugfix releases. Detailed information about all changes made in 
version 3.8.4 specifically can be found in its change log 
.
 Note that compared to 3.8.3, version 3.8.4 also contains the changes 
introduced in 3.8.4rc1.

We hope you enjoy Python 3.8!

Thanks to all of the many volunteers who help make Python Development and these 
releases possible! Please consider supporting our efforts by volunteering 
yourself or through organization contributions to the Python Software 
Foundation.

Your friendly release team,
Ned Deily @nad 
Steve Dower @steve.dower 
Łukasz Langa @ambv 
-- 
https://mail.python.org/mailman/listinfo/python-list


App for Moto e6 using Python?

2020-07-13 Thread Steve
I am looking for an app for my Moto e6 android phone that will accept a
number of hours and count down.  Then will beep every minute until I cancel
the app.  This is to remind me when to take my insulin.

 

It has been written in python but I do not know how to convert it to an app.
I wonder how much of the python code will still apply. When I was into this
in the past, I installed Kivy and was able to finally generate a "Hello
World" app and managed to get it to my phone. Then life called me back to
reality and I lost track of what I was doing for a few years. )-:  I doubt I
can go through that installation and learning curve again.

 

It works on my computer but I have projects that interfere with the alarm.  
This is why I would prefer to have it on my phone.

I appreciate any assistance you can provide.

Steve




Footnote:

There's 99 bugs in the code, in the code.

99 bugs in the code.

So I take one down and patch it all around.

Now there's 117 bugs in the code.

 

-

## Copyright Ambrosini 2017

#import re
#import random
import time
#import datetime
#from datetime import datetime

import winsound #as ws

#global delayTime
#global DelayTime

print()
print(" Enter 0 to test the alarm section.")
delayTime = input(" How many hours to next insulin check? (3) ")
if delayTime == "":
delayTime = 3
DelayTime = int(delayTime)
winsound.MessageBeep(-1)
print()
# =

def Alarm(D):
AX = 0
while D >= 1:
   
d = str(D)
AX += 1
ax = str(AX)
print(' ' + ax, end='...' + "\n") # minutes late
   
time.sleep(60)
D -= 1

import winsound #as wsBeep
winsound.MessageBeep(1)

def countdown(DelayTime):
import time
t = str(DelayTime)
if t == "1":
   print(" An alarm will start sounding in " + t + " hour...")
else:
   print(" An alarm will start sounding in " + t + " hours...")
   
while DelayTime >= 1:
t = str(DelayTime)
time.sleep(3600)
DelayTime -= 1
import winsound as wsBeep
wsBeep.MessageBeep(1)
 
print(' More Insuin? \n')
Alarm(3)

countdown(DelayTime)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: App for Moto e6 using Python?

2020-07-13 Thread Mike Dewhirst
On 14/07/2020 11:53 am, Steve wrote:
> I am looking for an app for my Moto e6 android phone that will accept a
> number of hours and count down.  Then will beep every minute until I cancel
> the app.  This is to remind me when to take my insulin.
>
>  
>
> It has been written in python but I do not know how to convert it to an app.
> I wonder how much of the python code will still apply. 

Have you looked at Beeware? I believe they have recently released for
Android.

Mike


> When I was into this
> in the past, I installed Kivy and was able to finally generate a "Hello
> World" app and managed to get it to my phone. Then life called me back to
> reality and I lost track of what I was doing for a few years. )-:  I doubt I
> can go through that installation and learning curve again.
>
>  
>
> It works on my computer but I have projects that interfere with the alarm.  
> This is why I would prefer to have it on my phone.
>
> I appreciate any assistance you can provide.
>
> Steve
>
> 
> 
>
> Footnote:
>
> There's 99 bugs in the code, in the code.
>
> 99 bugs in the code.
>
> So I take one down and patch it all around.
>
> Now there's 117 bugs in the code.
>
>  
>
> -
>
>

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