Re: OT: Using a fake Gmail address is probably not a good idea

2019-09-16 Thread Max Zettlmeißl via Python-list
On Mon, Sep 16, 2019 at 1:56 PM Skip Montanaro wrote: > Mails for someone here who goes by the handle "ast" with a fake > address of n...@gmail.com keep landing in my Gmail spam folder. I > suspect the same is true for all people subscribed to python-list who > use Gmail. Gmail (correctly, I think

Re: open, close

2019-09-01 Thread Max Zettlmeißl via Python-list
On Sat, Aug 31, 2019 at 3:43 PM Piet van Oostrum wrote: > > There is a difference here with the construct that the OP mentioned: > > lines = open("foo.txt").readlines() > > In that case the file COULD be closed, but there is no guarantee. It depends > on garbage collection. > In your case t

Re: open, close

2019-08-31 Thread Max Zettlmeißl via Python-list
On Sat, Aug 31, 2019 at 2:22 PM Manfred Lotz wrote: > > Could I use the latter as a substitute for the with-construct? > You can't use the second statement as a proper substitute for the first one. With the context manager, it is ensured that the file is closed. It's more or less equal to a "fin

Re: Program to find Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1.

2018-10-02 Thread Max Zettlmeißl via Python-list
On Tue, Oct 2, 2018 at 10:23 PM, Musatov wrote: > Primes of the form prime(n+2) * prime(n+1) - prime(n) +- 1. > DATA > > 31, 71, 73, 137, 211, 311, 419, 421, 647, 877, 1117, 1487, 1979, 2447, 3079, > 3547, 4027, 7307, 7309, 12211, 14243, 18911, 18913, 23557, 25439, 28729, > 36683, 37831

Re: So apparently I've been banned from this list

2018-09-30 Thread Max Zettlmeißl via Python-list
On Sun, Sep 30, 2018 at 6:30 PM, Steven D'Aprano wrote: > Notwithstanding Ethan's comment about having posted the suspension notice > on the list, I see no sign that he actually did so. At the risk of > further retaliation from the moderators, I am ignoring the ban in this > instance for the purpo

Re: help me in python plssss!!!!

2018-09-14 Thread Max Zettlmeißl via Python-list
On Fri, Sep 14, 2018 at 4:33 PM, Noel P. CUA wrote: > Calculate the true, relative and approximate errors, and Relate the > absolute relative approximate error to the number of significant digits. > > epsilon = 1 > > while epsilon + 1 > 1: > epsilon = epsilon / 2.0 > > epsilon = 2 * epsilon

Re: how to convert this psuedo code to python

2018-09-14 Thread Max Zettlmeißl via Python-list
On Fri, Sep 14, 2018 at 2:37 PM, Noel P. CUA wrote: > compose your own octave script to calculate the machine > epsilon. Analyze the code. > > epsilon = 1 > DO > IF (epsilon+1<=1) EXIT > epsilon = epsilon/2 > END DO > epsilon = 2 x epsilon > epsilon = 1 while epsilon + 1 > 1: epsilon = epsi

Re: Pretty printing dicts with compact=True

2018-09-11 Thread Max Zettlmeißl via Python-list
On Tue, Sep 11, 2018 at 1:58 PM, Nicolas Hug wrote: > pprint({x: x for x in range(15)}, compact=True) > > would be be printed in 15 lines while it could fit on 2. > > > Is this a bug or was this decided on purpose? It is on purpose as can be seen in the code for pprint [1], which calls _format [2

Re: "glob.glob('weirdness')" Any thoughts?

2018-09-10 Thread Max Zettlmeißl via Python-list
On Mon, Sep 10, 2018 at 3:05 PM, Thomas Jollans wrote: from glob import glob glob('test *') > ['test comment', 'test [co]mment', 'test [fallacy]', 'test [comments]', > 'test [comment] a'] glob('test [[]*') > ['test [co]mment', 'test [fallacy]', 'test [comments]', 'test [comment] a']

Re: "glob.glob('weirdness')" Any thoughts?

2018-09-10 Thread Max Zettlmeißl via Python-list
On Sun, Sep 9, 2018 at 6:03 PM, Thomas Jollans wrote: > On 09/09/2018 02:20 PM, Gilmeh Serda wrote: >> >> >> # Python 3.6.1/Linux >> (acts the same in Python 2.7.3 also, by the way) >> > from glob import glob >> >> > glob('./Testfile *') >> >> ['./Testfile [comment] some text.txt'] >>

Re: "glob.glob('weirdness')" Any thoughts?

2018-09-10 Thread Max Zettlmeißl via Python-list
On Sun, Sep 9, 2018 at 2:20 PM, Gilmeh Serda wrote: > > # Python 3.6.1/Linux > (acts the same in Python 2.7.3 also, by the way) > from glob import glob > glob('./Testfile *') > ['./Testfile [comment] some text.txt'] > glob('./Testfile [comment]*') > [] > glob('./Testfile [comme