Re: Run code automatically

2020-04-20 Thread hanan lamaazi
Yes, so to do it I save my code as filename.ipynb and go to terminal (cmd) I write the following commande: >> run for x in {1..10}; do (ipython filename.ipynb > /tmp/$x.log) & done it gives the following error: ERROR: root:File ''for.py'' not found I use another one: >> for filename in $(find

Re: Run code automatically

2020-04-20 Thread Souvik Dutta
No no I did not tell you to do it in that way. I said you could try putting the whole the code in the .py file in a for loop. That is:- for a in range(10): On Mon, 20 Apr, 2020, 1:55 pm hanan lamaazi, wrote: > Yes, so to do it I save my code as filename.ipynb and go to terminal (cmd) > I w

Why is a generator expression called a expression?

2020-04-20 Thread Veek M
The docs state that a expression is some combination of value, operator, variable and function. Also you cannot add or combine a generator expression with a value as you would do with 2 + 3 + 4. For example, someone on IRC suggested this all(a == 'a' for a in 'apple') but 1. all is a function/m

Re: Why is a generator expression called a expression?

2020-04-20 Thread Chris Angelico
On Mon, Apr 20, 2020 at 6:51 PM Veek M wrote: > > The docs state that a expression is some combination of value, operator, > variable and function. Also you cannot add or combine a generator > expression with a value as you would do with 2 + 3 + 4. For example, > someone on IRC suggested this > al

Re: Why is a generator expression called a expression?

2020-04-20 Thread Veek M
On Mon, 20 Apr 2020 19:19:31 +1000, Chris Angelico wrote: > In the case of a genexp, the expression has a value which is a generator > object. When you pass that to all(), it takes it and then iterates over but an object is NOT THE SAME as it's value! '2' is an object which happens to have a val

Re: Why is a generator expression called a expression?

2020-04-20 Thread Veek M
Also you will note, one can do: ( 2 if 3 > 2 else 4 ) + 4 so the () is just for precedence but otherwise a Conditional Expression works as expected by returning a value to be added to + 4. -- https://mail.python.org/mailman/listinfo/python-list

Re: Why is a generator expression called a expression?

2020-04-20 Thread DL Neil via Python-list
On 20/04/20 9:19 PM, Chris Angelico wrote: On Mon, Apr 20, 2020 at 6:51 PM Veek M wrote: The docs state that a expression is some combination of value, operator, variable and function. Also you cannot add or combine a generator expression with a value as you would do with 2 + 3 + 4. For exampl

Re: Why is a generator expression called a expression?

2020-04-20 Thread Veek M
but one can do the following (x for x in 'apple').next() * 2 def foo(): (yield 2) foo().next() * 3 (lambda x: 2)()*4 generator expr, yield expr, lambda expression all require some modification (insertion of a .next or explicit () so it's quite confusing.. expression seems to mean anything

Re: Why is a generator expression called a expression?

2020-04-20 Thread Chris Angelico
On Mon, Apr 20, 2020 at 8:26 PM Veek M wrote: > > but one can do the following > (x for x in 'apple').next() * 2 > > def foo(): >(yield 2) > foo().next() * 3 > > (lambda x: 2)()*4 > > generator expr, yield expr, lambda expression > all require some modification (insertion of a .next or explici

Re: Run code automatically

2020-04-20 Thread hanan lamaazi
Yes I try to do it but it doesn't work for two reasons: I write my code as blocks in jupyter notebook and for each block I use different datasets that I loc, iloc or concat according to my need. for this reasons I export it as .py file to run it externally

Re: RFC: For Loop Invariants

2020-04-20 Thread Tony Flury via Python-list
On 10/04/2020 21:44, Elliott Dehnbostel wrote: *We could do this:* chars = "abcaaabkjzhbjacvb" seek = {'a','b','c'} count = sum([1 for a in chars if a in seek]) However, this changes important semantics by creating an entire new list before summing. Creating the list is pointless in this ca

"pip" error message

2020-04-20 Thread Simone Bravin
Hello everyone, I just started using Python to learn a bit of coding, so I'm pretty a newbie to this, I tried to install few extra packages using pip but it doesn't work. When I check for pip version using command line> pip --version I get the following error message: Traceback (most recen

[RELEASE] Python 2.7.18, the end of an era

2020-04-20 Thread Benjamin Peterson
I'm eudaemonic to announce the immediate availability of Python 2.7.18. Python 2.7.18 is a special release. I refer, of course, to the fact that "2.7.18" is the closest any Python version number will ever approximate e, Euler's number. Simply exquisite! A less transcendent property of Python 2.

multiprocessing

2020-04-20 Thread Edward Montague
Upon using sympy's rubi_integrate upon my quad core computer, I find that the first CPU is being used 100%, whilst the other three are around 1% and 2% . I'm wondering if you have some code to overcome this limitation. -- https://mail.python.org/mailman/listinfo/python-list

Re: RFC: For Loop Invariants

2020-04-20 Thread Vincent Vande Vyvre
Le 20/04/20 à 13:08, Tony Flury via Python-list a écrit : > > On 10/04/2020 21:44, Elliott Dehnbostel wrote: >> *We could do this:* >> >> chars = "abcaaabkjzhbjacvb" >> seek = {'a','b','c'} >> count = sum([1 for a in chars if a in seek]) >> >> However, this changes important semantics by creating a

Re: "pip" error message

2020-04-20 Thread Richard Guinn
Hi Simone and all - I'm not sure how to fix/correct... but just a redundant 'me too'. I tried to install pybibframe (https://pypi.org/project/pybibframe/) and also keep getting errors. Wasn't sure if it was the module/package or what. My error is along the lines of: ERROR: Command errored out

Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread dcwhatthe
I'm validating several sites in a row, and most of them connect successfully. However, one of them immediately returns a 401. I'm using the exact same credentials to check this site, as when loggin in. Also, interestingly, it returns the 401 right away. I tried setting the timeout value for

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread Eli the Bearded
In comp.lang.python, wrote: > However, one of them immediately returns a 401. I'm using the exact > same credentials to check this site, as when loggin in. > > Also, interestingly, it returns the 401 right away. I tried setting the > timeout value for a ridiculously long time, but it passes th

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread dcwhatthe
On Monday, April 20, 2020 at 3:18:59 PM UTC-4, Eli the Bearded wrote: > In comp.lang.python, dc wrote: > > However, one of them immediately returns a 401. I'm using the exact > > same credentials to check this site, as when loggin in. > > > > Also, interestingly, it returns the 401 right away.

RE: Floating point problem

2020-04-20 Thread Schachner, Joseph
16 base 10 digits / log base10( 2) = 53.1508495182 bits. Obviously, fractional bits don't exist, so 53 bits. If you note that the first non-zero digit as 4, and the first digit after the 15 zeroes was 2, then you got an extra bit. 54 bits. Where did the extra bit come from? It came from the

Re: Floating point problem

2020-04-20 Thread Chris Angelico
On Tue, Apr 21, 2020 at 6:07 AM Schachner, Joseph wrote: > > 16 base 10 digits / log base10( 2) = 53.1508495182 bits. Obviously, > fractional bits don't exist, so 53 bits. If you note that the first non-zero > digit as 4, and the first digit after the 15 zeroes was 2, then you got an > extra

Re: Floating point problem

2020-04-20 Thread Richard Damon
On 4/20/20 4:19 PM, Chris Angelico wrote: > On Tue, Apr 21, 2020 at 6:07 AM Schachner, Joseph > wrote: >> 16 base 10 digits / log base10( 2) = 53.1508495182 bits. Obviously, >> fractional bits don't exist, so 53 bits. If you note that the first non-zero >> digit as 4, and the first digit after

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread dcwhatthe
On Monday, April 20, 2020 at 3:56:46 PM UTC-4, dcwh...@gmail.com wrote: > On Monday, April 20, 2020 at 3:18:59 PM UTC-4, Eli the Bearded wrote: > > In comp.lang.python, dc wrote: > > > However, one of them immediately returns a 401. I'm using the exact > > > same credentials to check this site, a

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread Eli the Bearded
In comp.lang.python, wrote, in reply to me: > "What do you think it is doing?" > I thought the timeout was waiting for a successful connection. A successful *connection* and a successful *authentication* are different things. $ telnet example.com 80 Trying 255.11.22.123... Connected to example

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread dcwhatthe
On Monday, April 20, 2020 at 5:02:23 PM UTC-4, Eli the Bearded wrote: > In comp.lang.python, dc wrote, in reply to me: > > "What do you think it is doing?" > > I thought the timeout was waiting for a successful connection. > > A successful *connection* and a successful *authentication* are > diff

Getting the dependencies of a function from a library

2020-04-20 Thread elisha hollander
I have a python library with a function. This function call some other functions, classes and variable from the library (and those functions and classes call other ones, etc)... Can I automatically create a file with all of the dependencies (and nothing else)? (Already posted on stack overflow with

Regarding problem faced to run pandas

2020-04-20 Thread Amit Jain
Dear Sir/Madam, After successful installation of PIP for PANDAS when I try to run any program, It gives error (Screenshot attached) The screenshot of the problem is attached herewith for your kind information . Kindly help me to resolve such problem. -- *Thanks & Regards

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread Eli the Bearded
In comp.lang.python, wrote: > On Monday, April 20, 2020 at 5:02:23 PM UTC-4, Eli the Bearded wrote: > > For an example, back to telnet again. > > > > $ telnet example.com 80 > > Trying 255.11.22.123... > > Connected to example.com > > Escape character is '^]'. > > GET /digest/ HTTP/1.1 > > Host:

Re: Regarding problem faced to run pandas

2020-04-20 Thread Souvik Dutta
Are you that youtuber Amit Jain? And for your kind information you cannot attach any screenshot in python-list. It gets dropped. Souvik flutter dev On Tue, Apr 21, 2020, 4:39 AM Amit Jain wrote: > Dear Sir/Madam, > After successful installation of PIP for PANDAS when I try to run any > program

Re: "pip" error message

2020-04-20 Thread Souvik Dutta
Have you tried updating pip? There was a bug in pip version 10 Souvik flutter dev On Mon, Apr 20, 2020, 10:10 PM Simone Bravin wrote: > Hello everyone, > > > I just started using Python to learn a bit of coding, so I'm pretty a > > newbie to this, I tried to install few extra packages using

Re: Getting the dependencies of a function from a library

2020-04-20 Thread Bob Gailer
For me the question is a little vague. What do you mean by Library? Could you give us a simple example of the input and the output? It's possible to interpret your question as an assessment of your skill level. We know nothing about your skill level. It's possible to interpret your question as

Re: Getting the dependencies of a function from a library

2020-04-20 Thread DL Neil via Python-list
On 21/04/20 9:40 AM, elisha hollander wrote: I have a python library with a function. This function call some other functions, classes and variable from the library (and those functions and classes call other ones, etc)... Can I automatically create a file with all of the dependencies (and nothin

Re: Getting the dependencies of a function from a library

2020-04-20 Thread Juergen Brendel
Hello! Not sure what's vague about the question, I think it was pretty clear. Imagine this: >>> import requests >>> >>> magic_function(requests.get) . prints big output of all other functions and libraries used by . requests.get, plus all the functions used by those functions, .