Re: sum() vs. loop

2021-10-11 Thread Dan Stromberg
On Mon, Oct 11, 2021 at 2:54 PM Steve Keller wrote: > I have found the sum() function to be much slower than to loop over the > operands myself: > > def sum_products(seq1, seq2): > return sum([a * b for a, b in zip(seq1, seq2)]) > > def sum_products2(seq1, seq2): > sum = 0 > for a, b

Re: spyder does not work under root! [linux]

2021-10-11 Thread Michael Torrie
On 10/8/21 4:32 PM, Paulo da Silva wrote: > Às 22:56 de 08/10/21, Paulo da Silva escreveu: >> Hi! >> >> I need to debug a python3 script under root. I tried spyder but it does >> not work. >> >> Running as root without --no-sandbox is not supported. See >> https://crbug.com/638180. >> >> Thanks for

Re: Beginner problem, please help. Building a simple menu + lists , cannot print list

2021-10-11 Thread Chris Angelico
On Tue, Oct 12, 2021 at 9:13 AM Felix Kjellström wrote: > > Hello! Please see the link to the code I have uploaded to my account at > replit.com > > https://replit.com/join/lftxpszwrv-felixkjellstrom Unfortunately, it's not public. Are you able to put the code on GitHub as a repository or gist,

Re: Assign a value to a var content in an object

2021-10-11 Thread Chris Angelico
On Tue, Oct 12, 2021 at 9:03 AM Paulo da Silva wrote: > > Hello! > > Is there a better way of doing this? > Why didn't setattr (as commented) work? > > Thanks for an help/comments. > > class C: > def f(self,v): > #setattr(self,n,v) > self.__dict__['n']=v > > c=C() > c.f(3) > pr

Re: sum() vs. loop

2021-10-11 Thread Chris Angelico
On Tue, Oct 12, 2021 at 9:02 AM Stefan Ram wrote: > > Steve Keller writes: > >Now completely surprised. > > I have observed that here the generator-based sum() call > is slower if both seq1 and seq2 have a length of 1000, but > faster if both seq1 and seq2 have 1000 entries each > (wi

Beginner problem, please help. Building a simple menu + lists , cannot print list

2021-10-11 Thread Felix Kjellström
Hello! Please see the link to the code I have uploaded to my account at replit.com https://replit.com/join/lftxpszwrv-felixkjellstrom Problem: When you select the menu option "Add buyer", you can enter three values. See code line 5, "def Add_buyer ():" Then, you use the arrow keys to select t

Re: sum() vs. loop

2021-10-11 Thread Chris Angelico
On Tue, Oct 12, 2021 at 8:55 AM Steve Keller wrote: > > I have found the sum() function to be much slower than to loop over the > operands myself: > > def sum_products(seq1, seq2): > return sum([a * b for a, b in zip(seq1, seq2)]) > > def sum_products2(seq1, seq2): > sum = 0 > for a, b

Re: Assign a value to a var content in an object

2021-10-11 Thread Paulo da Silva
Às 23:28 de 10/10/21, Stefan Ram escreveu: > Paulo da Silva writes: >> class C: >>def f(self,v): >>#setattr(self,n,v) >>self.__dict__['n']=v > >> Why didn't setattr (as commented) work? > > Because the name n has not been initialized to a suitable > value in the function

Re: spyder does not work under root! [linux]

2021-10-11 Thread Chris Angelico
On Tue, Oct 12, 2021 at 8:52 AM Paulo da Silva wrote: > > Hi! > > I need to debug a python3 script under root. I tried spyder but it does > not work. > > Running as root without --no-sandbox is not supported. See > https://crbug.com/638180. > > Thanks for any comments including alternative solutio

Assign a value to a var content in an object

2021-10-11 Thread Paulo da Silva
Hello! Is there a better way of doing this? Why didn't setattr (as commented) work? Thanks for an help/comments. class C: def f(self,v): #setattr(self,n,v) self.__dict__['n']=v c=C() c.f(3) print(c.n) -- https://mail.python.org/mailman/listinfo/python-list

Re: sum() vs. loop

2021-10-11 Thread Steve Keller
Christian Gollwitzer writes: > > def sum_products(seq1, seq2): > > return sum([a * b for a, b in zip(seq1, seq2)]) > > def sum_products2(seq1, seq2): > > sum = 0 > > for a, b in zip(seq1, seq2): > > sum += a * b > > return sum > > [...] > > The first version construct

Re: sum() vs. loop

2021-10-11 Thread Christian Gollwitzer
Am 10.10.21 um 10:49 schrieb Steve Keller: I have found the sum() function to be much slower than to loop over the operands myself: def sum_products(seq1, seq2): return sum([a * b for a, b in zip(seq1, seq2)]) def sum_products2(seq1, seq2): sum = 0 for a, b in zip(seq1, seq2):

Re: spyder does not work under root! [linux]

2021-10-11 Thread Paulo da Silva
Às 22:56 de 08/10/21, Paulo da Silva escreveu: > Hi! > > I need to debug a python3 script under root. I tried spyder but it does > not work. > > Running as root without --no-sandbox is not supported. See > https://crbug.com/638180. > > Thanks for any comments including alternative solutions to d

sum() vs. loop

2021-10-11 Thread Steve Keller
I have found the sum() function to be much slower than to loop over the operands myself: def sum_products(seq1, seq2): return sum([a * b for a, b in zip(seq1, seq2)]) def sum_products2(seq1, seq2): sum = 0 for a, b in zip(seq1, seq2): sum += a * b return sum In a program

spyder does not work under root! [linux]

2021-10-11 Thread Paulo da Silva
Hi! I need to debug a python3 script under root. I tried spyder but it does not work. Running as root without --no-sandbox is not supported. See https://crbug.com/638180. Thanks for any comments including alternative solutions to debug as root. Paulo -- https://mail.python.org/mailman/listinfo

installazione numpy

2021-10-11 Thread stefano felli
l'installazione di numpy con pip install numpy fornisce errore Building wheel for numpy (PEP 517) ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly A cosa è dovuto e come devo fare per installa

Re: HELP - uninstall pyton error

2021-10-11 Thread Michel
give more details OS, Python Version, Method of installation.. etc.. On 10/7/21 17:18, Almadar Plus wrote: Could you please help me uninstall python? see attached screenshots files Regards -- https://mail.python.org/mailman/listinfo/python-list

nrfutil icorrect installation

2021-10-11 Thread Gerhard van Rensburg
Dear python, I installed Python 3.10.0 I then install pip install nrfutil When I try to run nrfutil, I get ModuleNotFoundError: No module named 'constants' C:\Users\ x\nrfutil keys --help Traceback (most recent call last): File "C:\Users\Gerhard van Rensburg\AppData\Local\Pro