Re: Helping Windows first time users

2020-04-19 Thread Barry Scott



> On 18 Apr 2020, at 21:00, boB Stepp  wrote:
> 
> On Wed, Apr 15, 2020 at 2:04 PM Barry Scott  wrote:
>> 
>> I post some suggestion to improve the Python installer for Windows
>> to better sign post users on the next steps.
>> 
>> https://mail.python.org/archives/list/python-id...@python.org/message/TKHID7PMKN5TK5QDQ2BL3G45FYAJNYJX/
>> 
>> It also seems like we could do with drafting the text of a helpful
>> reply to help the Windows first time users. This would help folks that
>> reply to the Windows first time users to have a quick way to reply
>> without drafting the text a reply every time.
>> 
>> What are your thoughts on the installer changes and reply text?
> 
> I wonder if the last screen of the installer should have a checkbox,
> checked by default, that launches IDLE.  IDLE would then display a
> helpful text file on this first launch describing how to use IDLE, how
> to find and launch it again, etc.  As well have it describe all of the
> help you are advocating here as well.  It would be a minor annoyance
> for experienced users to have to uncheck the box before clicking
> finish, but I think it might have a good chance of getting new users
> off to a reliable start.  Many other Windows program installers are
> setup similarly to launch the program being installed.  This is a
> little different as IDLE is not Python, but that is a minor quibble, I
> think.

The problem with launching IDLE from the installer is that the user is not
shown how do it without the installer.

Launching a "Getting started" with the how to steps might work better
on that checkbox.

Barry


> 
> 
> -- 
> boB
> 

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


Re: Helping Windows first time users

2020-04-19 Thread Pieter van Oostrum
boB Stepp  writes:

> On Wed, Apr 15, 2020 at 2:04 PM Barry Scott  wrote:
>>
>> I post some suggestion to improve the Python installer for Windows
>> to better sign post users on the next steps.
>>
>> https://mail.python.org/archives/list/python-id...@python.org/message/TKHID7PMKN5TK5QDQ2BL3G45FYAJNYJX/
>>
>> It also seems like we could do with drafting the text of a helpful
>> reply to help the Windows first time users. This would help folks that
>> reply to the Windows first time users to have a quick way to reply
>> without drafting the text a reply every time.
>>
>> What are your thoughts on the installer changes and reply text?
>
> I wonder if the last screen of the installer should have a checkbox,
> checked by default, that launches IDLE.  IDLE would then display a
> helpful text file on this first launch describing how to use IDLE, how
> to find and launch it again, etc.  As well have it describe all of the
> help you are advocating here as well.  It would be a minor annoyance
> for experienced users to have to uncheck the box before clicking
> finish, but I think it might have a good chance of getting new users
> off to a reliable start.  Many other Windows program installers are
> setup similarly to launch the program being installed.  This is a
> little different as IDLE is not Python, but that is a minor quibble, I
> think.

Or just display a short HTML page describing the first steps to start
using Python. It could mention the command line (py) to be used with a
text editor (some recommendations) and IDLE. And how not to double click
.py files :)
-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Floating point problem

2020-04-19 Thread Pieter van Oostrum
"R.Wieser"  writes:

> Souvik,
>
>> I have one question here. On using print(f"{c:.32f}") where c= 2/5
>> instead of getting 32 zeroes I got some random numbers. The exact
>> thing is 0.40002220446049250313 Why do I get
>> this and not 32 zeroes?
>
> Simple answer ?   The conversion routine runs outof things to say.
>
> A bit more elaborate answer ? You should not even have gotten that many 
> zeroes after the 0.4.The precision of a 32-bit float is about 7 digits. 
> That means that all you can depend on is the 0.4 followed by 6 more digits. 
> Anything further is, in effect, up for grabs.
>
Most Python implementations use 64-bit doubles (53 bits of precision). See 
https://docs.python.org/3.8/tutorial/floatingpoint.html
-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list


Not understood error with __set_name__ in a descriptor class

2020-04-19 Thread ast

Hello

This code is working well: (I am using python 3.6.3)


class my_property:
def __init__(self, fget=None, fset=None, fdel=None):
self.fget = fget
self.fset = fset
self.fdel = fdel
def __set_name__(self, owner, name):
self._name = name
print("Inside __set_name__ method:  ", self._name)

##def __get__(self, instance, owner):
##return self.fget(instance)


class Test:
celsius = my_property()

print("Outside __set_name__ method: ", Test.celsius._name)


Here is the output:

= RESTART: C:/Users/jm/Desktop/python/my_property.py =
Inside __set_name__ method:   celsius
Outside __set_name__ method:  celsius


And this one doesn't. (I just removed ## to uncomment the 2 lines)
Do you understand why ?

class my_property:
def __init__(self, fget=None, fset=None, fdel=None):
self.fget = fget
self.fset = fset
self.fdel = fdel
def __set_name__(self, owner, name):
self._name = name
print("Inside __set_name__ method:  ", self._name)

def __get__(self, instance, owner):
return self.fget(instance)


class Test:
celsius = my_property()

print("Outside __set_name__ method: ", Test.celsius._name)

Here is the output:

= RESTART: C:/Users/jm/Desktop/python/my_property.py =
Inside __set_name__ method:   celsius
Traceback (most recent call last):
  File "C:/Users/jm/Desktop/python/my_property.py", line 17, in 
print("Outside __set_name__ method: ", Test.celsius._name)
  File "C:/Users/jm/Desktop/python/my_property.py", line 11, in __get__
return self.fget(instance)
TypeError: 'NoneType' object is not callable
--
https://mail.python.org/mailman/listinfo/python-list


Re: Not understood error with __set_name__ in a descriptor class

2020-04-19 Thread ast

Le 19/04/2020 à 17:06, ast a écrit :

I understood where the problem is.

Once __get__ is defined, it is used to read self._name in method
__set_name__ and it is not défined yet. That's why I have
an error "'NoneType' object is not callable"
Thats a nice bug.
I need to think for a workaround


Hello

This code is working well: (I am using python 3.6.3)


class my_property:
     def __init__(self, fget=None, fset=None, fdel=None):
     self.fget = fget
     self.fset = fset
     self.fdel = fdel
     def __set_name__(self, owner, name):
     self._name = name
     print("Inside __set_name__ method:  ", self._name)

##    def __get__(self, instance, owner):
##    return self.fget(instance)


class Test:
     celsius = my_property()

print("Outside __set_name__ method: ", Test.celsius._name)


Here is the output:

= RESTART: C:/Users/jm/Desktop/python/my_property.py =
Inside __set_name__ method:   celsius
Outside __set_name__ method:  celsius


And this one doesn't. (I just removed ## to uncomment the 2 lines)
Do you understand why ?

class my_property:
     def __init__(self, fget=None, fset=None, fdel=None):
     self.fget = fget
     self.fset = fset
     self.fdel = fdel
     def __set_name__(self, owner, name):
     self._name = name
     print("Inside __set_name__ method:  ", self._name)

     def __get__(self, instance, owner):
     return self.fget(instance)


class Test:
     celsius = my_property()

print("Outside __set_name__ method: ", Test.celsius._name)

Here is the output:

= RESTART: C:/Users/jm/Desktop/python/my_property.py =
Inside __set_name__ method:   celsius
Traceback (most recent call last):
   File "C:/Users/jm/Desktop/python/my_property.py", line 17, in 
     print("Outside __set_name__ method: ", Test.celsius._name)
   File "C:/Users/jm/Desktop/python/my_property.py", line 11, in __get__
     return self.fget(instance)
TypeError: 'NoneType' object is not callable


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


Re: Springer released free ebooks (epub and pdf)

2020-04-19 Thread Souvik Dutta
Thanks(for posting) those help.

On Sun, 19 Apr, 2020, 4:37 am DL Neil via Python-list, <
python-list@python.org> wrote:

> Springer (publisher) has released a bunch of eBook versions of Python
> text-books, free to download (.PDF and/or .EPUB), in support of COVID-19
> stay-at-homes.
>
> This sub-list features texts for all 'levels' of mastery, and published
> between 2014 and 2019/20. They tend to be 'solid' content, cf 'Dummies
> Guide' casual:
>
> https://www.reddit.com/r/Python/comments/g2yfml/springer_released_free_ebooks_epub_and_pdf/
> --
> Regards,
> =dn
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Not understood error with __set_name__ in a descriptor class

2020-04-19 Thread Dieter Maurer
ast wrote at 2020-4-19 17:14 +0200:
>Le 19/04/2020 à 17:06, ast a écrit :
>I understood where the problem is.
>
>Once __get__ is defined, it is used to read self._name in method
>__set_name__ and it is not défined yet. That's why I have
>an error "'NoneType' object is not callable"
>Thats a nice bug.

What about the following (more straight forward) interpretation:

  In your test class, you call `my_property` without parameters.
  This means that the instance has `fget is None` and (therefore)
  `__get__` will raise the exception.

As you have already found out, `Test.celsius` invokes `__get__`
(with `instance is None`) and you get the observed error.

> ...
>> This code is working well: (I am using python 3.6.3)
>>
>> 
>> class my_property:
>>      def __init__(self, fget=None, fset=None, fdel=None):
>>      self.fget = fget
>>      self.fset = fset
>>      self.fdel = fdel
>>      def __set_name__(self, owner, name):
>>      self._name = name
>>      print("Inside __set_name__ method:  ", self._name)
>>
>> ##    def __get__(self, instance, owner):
>> ##    return self.fget(instance)
>>
>>
>> class Test:
>>      celsius = my_property()
>>
>> print("Outside __set_name__ method: ", Test.celsius._name)
>>
>>
>> Here is the output:
>>
>> = RESTART: C:/Users/jm/Desktop/python/my_property.py =
>> Inside __set_name__ method:   celsius
>> Outside __set_name__ method:  celsius
>> 
>>
>> And this one doesn't. (I just removed ## to uncomment the 2 lines)
>> Do you understand why ?
>>
>> class my_property:
>>      def __init__(self, fget=None, fset=None, fdel=None):
>>      self.fget = fget
>>      self.fset = fset
>>      self.fdel = fdel
>>      def __set_name__(self, owner, name):
>>      self._name = name
>>      print("Inside __set_name__ method:  ", self._name)
>>
>>      def __get__(self, instance, owner):
>>      return self.fget(instance)
>>
>>
>> class Test:
>>      celsius = my_property()
>>
>> print("Outside __set_name__ method: ", Test.celsius._name)
>>
>> Here is the output:
>>
>> = RESTART: C:/Users/jm/Desktop/python/my_property.py =
>> Inside __set_name__ method:   celsius
>> Traceback (most recent call last):
>>    File "C:/Users/jm/Desktop/python/my_property.py", line 17, in 
>>      print("Outside __set_name__ method: ", Test.celsius._name)
>>    File "C:/Users/jm/Desktop/python/my_property.py", line 11, in __get__
>>      return self.fget(instance)
>> TypeError: 'NoneType' object is not callable
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Not understood error with __set_name__ in a descriptor class

2020-04-19 Thread Peter Otten
Unknown wrote:

> Le 19/04/2020 à 17:06, ast a écrit :
> 
> I understood where the problem is.
> 
> Once __get__ is defined, it is used to read self._name in method
> __set_name__ and it is not défined yet. That's why I have
> an error "'NoneType' object is not callable"
> Thats a nice bug.

It's the fget attribute that is None. You can verify that by setting it to 
something else:

class my_property:
def __init__(self, fget=None, fset=None, fdel=None):
self.fget = "fget"
...

> I need to think for a workaround

__get__() usually returns self if it's called on the class:

def __get__(self, instance, owner):
if instance is None:
return self
...

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


Re: Helping Windows first time users

2020-04-19 Thread boB Stepp
On Sun, Apr 19, 2020 at 4:30 AM Barry Scott  wrote:
>
>
>
> > On 18 Apr 2020, at 21:00, boB Stepp  wrote:
> >
> > On Wed, Apr 15, 2020 at 2:04 PM Barry Scott  wrote:

> >> What are your thoughts on the installer changes and reply text?
> >
> > I wonder if the last screen of the installer should have a checkbox,
> > checked by default, that launches IDLE.  IDLE would then display a
> > helpful text file on this first launch describing how to use IDLE, how
> > to find and launch it again, etc.  As well have it describe all of the
> > help you are advocating here as well.  It would be a minor annoyance
> > for experienced users to have to uncheck the box before clicking
> > finish, but I think it might have a good chance of getting new users
> > off to a reliable start.  Many other Windows program installers are
> > setup similarly to launch the program being installed.  This is a
> > little different as IDLE is not Python, but that is a minor quibble, I
> > think.
>
> The problem with launching IDLE from the installer is that the user is not
> shown how do it without the installer.
>
> Launching a "Getting started" with the how to steps might work better
> on that checkbox.

IDLE can display text files as well as .py/.pyw files.  Are there
technical reasons why it would be difficult to have the first opening
of IDLE showing the contents of an informative text file as you
suggest?  One drawback is that there would be no clickable links if
this were done.

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


rubi integrate

2020-04-19 Thread Edward Montague
 After wrestling with version incompatibilities and incomplete
code, I have produced test code and an edited version of
rubi.py  .
 For rubi.py I found it necessary to replace exp with rubi_exp,
in a few locations; you may want to check this, files are attached. Perhaps
this isn't an issue with a more recent version of sympy.

I'm using Ubuntu 19.10, python 3.7.6, gcc  7.3.0, pip3 version
20.0.2.
  Sympy 1.4, matchpy 0.5.1, numpy 1.8.1, scipy 1.3.3 .
-- 
https://mail.python.org/mailman/listinfo/python-list