Python-list Digest, Vol 169, Issue 44

Deught Chilapondwa dchilapondwa3 at gmail.com
Wed Oct 25 12:19:50 EDT 2017


Sir, You have been sending me alot of messages but hardly can I understand.
Offcourse I registered with you, but I can't understand the messages
reharding what I should do.
Can you come back to me with clarification? Impatienly waiting to hear from
you.
Deught Chilapondwa.

On 25 Oct 2017 6:01 pm, <python-list-request at python.org> wrote:

> Send Python-list mailing list submissions to
>         python-list at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mail.python.org/mailman/listinfo/python-list
> or, via email, send a message with subject or body 'help' to
>         python-list-request at python.org
>
> You can reach the person managing the list at
>         python-list-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Python-list digest..."
>
> Today's Topics:
>
>    1. Re: right list for SIGABRT python binary question ?
>       (M.-A. Lemburg)
>    2. Re: Compression of random binary data (Stefan Ram)
>    3. Re: Compression of random binary data (Peter J. Holzer)
>    4. Re: Compression of random binary data (Peter Pearson)
>    5. Re: Compression of random binary data (Ian Kelly)
>    6. Re: Compression of random binary data (Steve D'Aprano)
>    7. Re: Compression of random binary data (Steve D'Aprano)
>    8. Re: Compression of random binary data (Chris Angelico)
>    9. Re: Compression of random binary data (Richard Damon)
>   10. h5py.File() gives error message (C W)
>   11. Re: h5py.File() gives error message (Rob Gaddi)
>   12. Re: h5py.File() gives error message (Dennis Lee Bieber)
>   13. Re: h5py.File() gives error message (Dennis Lee Bieber)
>   14. Objects with __name__ attribute (ast)
>   15. Re: Objects with __name__ attribute (Peter Otten)
>   16. Re: h5py.File() gives error message (C W)
>   17. Re: Compression of random binary data (Gregory Ewing)
>   18. Re: Compression of random binary data (Gregory Ewing)
>   19. Re: Compression of random binary data (Gregory Ewing)
>   20. Re: Sockets but calling from different programs (Cameron Simpson)
>   21. Re: h5py.File() gives error message (Peter Otten)
>   22. Re: right list for SIGABRT python binary question ?
>       (Karsten Hilbert)
>   23. Let's talk about debuggers! (Thomas Jollans)
>   24. Re: Compression of random binary data (Ian Kelly)
>   25. Re: Let's talk about debuggers! (Fabien)
>   26. Re: h5py.File() gives error message (C W)
>   27. Re: Let's talk about debuggers! (Rustom Mody)
>   28. Re: Let's talk about debuggers! (Ned Batchelder)
>   29. Re: Let's talk about debuggers! (Michele Simionato)
>   30. Re: Let's talk about debuggers! (Bill)
>   31. Re: Compression of random binary data
>       (danceswithnumbers at gmail.com)
>   32. Re: Let's talk about debuggers! (William Ray Wing)
>   33. Test Bank for Campbell Biology 11th Edition by Urry, Cain
>       (kkgsrkmk at gmail.com)
>
>
> ---------- Forwarded message ----------
> From: "M.-A. Lemburg" <mal at egenix.com>
> To: Karsten Hilbert <Karsten.Hilbert at gmx.net>, python-list at python.org
> Cc:
> Bcc:
> Date: Tue, 24 Oct 2017 20:47:58 +0200
> Subject: Re: right list for SIGABRT python binary question ?
>
>
> On 22.10.2017 22:15, Karsten Hilbert wrote:
> > On Sat, Oct 21, 2017 at 07:10:31PM +0200, M.-A. Lemburg wrote:
> >
> >>> Running a debug build of py27 gave me a first lead: this
> >>> Debian system (Testing, upgraded all the way from various
> >>> releases ago) carries an incompatible mxDateTime which I'll
> >>> take care of.
> >>>
> >>>     *** You don't have the (right) mxDateTime binaries installed !
> >>>     Traceback (most recent call last):
> >>>       File "./bootstrap_gm_db_system.py", line 87, in <module>
> >>>         from Gnumed.pycommon import gmCfg2, gmPsql, gmPG2, gmTools,
> gmI18N
> >>>       File "/home/ncq/Projekte/gm-git/gnumed/gnumed/Gnumed/pycommon/gmPG2.py",
> line 34, in <module>
> >>>         from Gnumed.pycommon import gmDateTime
> >>>       File "/home/ncq/Projekte/gm-git/gnumed/gnumed/Gnumed/pycommon/gmDateTime.py",
> line 52, in <module>
> >>>         import mx.DateTime as mxDT
> >>>       File "/usr/lib/python2.7/dist-packages/mx/DateTime/__init__.py",
> line 8, in <module>
> >>>         from DateTime import *
> >>>       File "/usr/lib/python2.7/dist-packages/mx/DateTime/DateTime.py",
> line 9, in <module>
> >>>         from mxDateTime import *
> >>>       File "/usr/lib/python2.7/dist-packages/mx/DateTime/mxDateTime/__init__.py",
> line 13, in <module>
> >>>         raise ImportError, why
> >>>     ImportError: /usr/lib/python2.7/dist-packages/mx/DateTime/mxDateTime/mxDateTime.so:
> undefined symbol: Py_InitModule4
> >>
> >> This error suggests that you have 32- and 64-bit versions of
> >> Python and mxDateTime mixed in your installation.
> >>
> >> Py_InitModule4 is only available in the 32-bit build of
> >> Python. With the 64-bit build, it's called Py_InitModule4_64.
> >>
> >> Since you're getting the same error from faulthandler,
> >> this is where I'd start to investigate.
> >>
> >> "nm" will list all exported and required symbols. As first step,
> >> you should probably check the python binary for its symbols and
> >> see whether it exports Py_InitModule* symbols.
> >
> > Thanks for your input !
> >
> > The python2.7-dbg build is 32 bits:
> >
> >       root at hermes:~# nm /usr/bin/python2.7-dbg | grep Py_InitM
> >       00155b9f T Py_InitModule4TraceRefs
> >
> >
> >       python2.7-dbg:
> >         Installiert:           2.7.14-2
> >         Installationskandidat: 2.7.14-2
> >         Versionstabelle:
> >        *** 2.7.14-2 500
> >               500 http://httpredir.debian.org/debian unstable/main i386
> Packages
> >               100 /var/lib/dpkg/status
> >            2.7.13-2 990
> >               500 http://httpredir.debian.org/debian stretch/main i386
> Packages
> >               990 http://httpredir.debian.org/debian buster/main i386
> Packages
> >
> > The python2.7 build (no -dbg) does not have symbols.
> >
> > mxDateTime really should be 32 bits, too:
> >
> >       python-egenix-mxdatetime:
> >         Installiert:           3.2.9-1
> >         Installationskandidat: 3.2.9-1
> >         Versionstabelle:
> >        *** 3.2.9-1 990
> >               500 http://httpredir.debian.org/debian stretch/main i386
> Packages
> >               990 http://httpredir.debian.org/debian buster/main i386
> Packages
> >               500 http://httpredir.debian.org/debian unstable/main i386
> Packages
> >               100 /var/lib/dpkg/status
> >
> > Let me check the .so file:
> >
> >       root at hermes:~# nm /usr/lib/python2.7/dist-packages/mx/DateTime/mxDateTime/mxDateTime_d.so
> | grep Py_InitM
> >                U Py_InitModule4TraceRefs
> >
> > It seems it is - hm ...
>
> Could you check whether you have similar import errors with
> other modules that have C extensions ? E.g. lxml.
>
> What you're seeing appears to be a compilation problem
> with Python 2.7.14 on Debian. The executable doesn't appear
> to export its symbols to the .so files, or only some of them.
>
> --
> Marc-Andre Lemburg
> eGenix.com
>
> Professional Python Services directly from the Experts
> >>> Python Projects, Coaching and Consulting ...  http://www.egenix.com/
> >>> Python Database Interfaces ...           http://products.egenix.com/
> >>> Plone/Zope Database Interfaces ...           http://zope.egenix.com/
> ________________________________________________________________________
>
> ::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::
>
>    eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
>     D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
>            Registered at Amtsgericht Duesseldorf: HRB 46611
>                http://www.egenix.com/company/contact/
>
>
>
> ---------- Forwarded message ----------
> From: Stefan Ram <ram at zedat.fu-berlin.de>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: 24 Oct 2017 18:55:34 GMT
> Subject: Re: Compression of random binary data
> Ben Bacarisse <ben.usenet at bsb.me.uk> writes:
> >All generalisations are false.  I was being hyperbolic.
>
>   I think that I already gave my definition recently:
>
>       A bit source is /random/, when every party has a
>       probability of no more than 0.5 to correctly predict
>       the next bit in a black-box test (not knowing the
>       internals of the source).
>
>   I add today:
>
>   The above definition assumes that the bit source does
>   not learn about the predictions, so that it cannot
>   intentionally generate bits depending on the predictions
>   of any party.
>
>   We cannot experimentally test whether the assertion that
>   a bit source is random is true (in an absolute sense of
>   "true"), but at least we can test whether a bit source is
>   random with /a certain confidence/ (such as 0.99).
>
>   Or, when we know how the generator is built, we can predict
>   whether it should be random according to its construction
>   and our theories.
>
>   Using quantum devices we can drop the black-box condition
>   and even construct white-box random devices.
>
>   Quantum mechanics surely teaches us how to prepare a photon
>   so that the probability of it passing a certain polarization
>   filter is 0.5. And we can say that this is a perfect random
>   generator and even use it to /define/ the meaning of "random":
>   The bits it gives to us are "random bits". This is the
>   ideal random bit generator, and an algorithm can provide an
>   approximation of its behavior. See also: arxiv.org/pdf/1004.1521
>   .
>
>
>
>
> ---------- Forwarded message ----------
> From: "Peter J. Holzer" <hjp-usenet3 at hjp.at>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Tue, 24 Oct 2017 22:09:56 +0200
> Subject: Re: Compression of random binary data
> On 2017-10-23 04:21, Steve D'Aprano <steve+python at pearwood.info> wrote:
> > On Mon, 23 Oct 2017 02:29 pm, Stefan Ram wrote:
> >>
> > If the probability of certain codes (either single codes, or sequences of
> > codes) are non-equal, then you can take advantage of that by encoding the
> > common cases into a short representation, and the uncommon and rare cases
> > into a longer representation. As you say:
> >
> >
> >>   Otherwise, if ( 0, 0 ) is much more frequent,
> >>   we can encode ( 0, 0 ) by "0" and
> >>
> >> ( 0, 1 ) by "101",
> >> ( 1, 0 ) by "110", and
> >> ( 1, 1 ) by "111".
> >>
> >>   And we could then use /less/ than two bits on the
> >>   average.
> >
> > That's incorrect. On average you use 2.5 bits.
> >
> > (1*1 bit + 3*3 bits divide by four possible outcomes, makes 2.5 bits.)
>
> I disagree. If the distribution is not equal, then the average needs to
> take the different probabilities into account.
>
> Let's assume that (0, 0) has a probability of 90 %, (0, 1) a probability
> of 10 % and (1, 0) and (1, 1) a probability of 5 % each.
>
> Then the average length is
>
>     0.9 * 1 bit + 0.1 * 3 bits + 0.05 * 3 bits + 0.05 * 3 bits = 1.5 bits.
>
>         hp
>
>
> --
>    _  | Peter J. Holzer    | Fluch der elektronischen Textverarbeitung:
> |_|_) |                    | Man feilt solange an seinen Text um, bis
> | |   | hjp at hjp.at         | die Satzbestandteile des Satzes nicht mehr
> __/   | http://www.hjp.at/ | zusammenpaßt. -- Ralph Babel
>
>
>
> ---------- Forwarded message ----------
> From: Peter Pearson <pkpearson at nowhere.invalid>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: 24 Oct 2017 21:18:10 GMT
> Subject: Re: Compression of random binary data
> On Tue, 24 Oct 2017 14:51:37 +1100, Steve D'Aprano wrote:
>   On Tue, 24 Oct 2017 01:27 pm, danceswithnumbers at gmail.com wrote:
>   > Yes! Decode reverse is easy......sorry so excited i could shout.
>
>   Then this should be easy for you:
>
>   http://marknelson.us/2012/10/09/the-random-compression-
> challenge-turns-ten/
>
>   All you need to do is compress this file:
>
>   http://marknelson.us/attachments/million-digit-challenge/
> AMillionRandomDigits.bin
>
>   to less than 415241 bytes, and you can win $100.
>
> Then, on Mon, 23 Oct 2017 21:13:00 -0700 (PDT), danceswithnumbers wrote:
> > I did that quite a while ago.
>
>
> But 352,954 kb > 415241 bytes, by several orders of magnitude; so
> you didn't "do that".  (Or are we using the European decimal point?)
>
> If you're claiming 352,954 *bytes*, not kb, I invite you to explain
> why you have not collected Mark Nelson's $100 prize, and untold fame
> and glory; failing which, your credibility will evaporate.
>
> --
> To email me, substitute nowhere->runbox, invalid->com.
>
>
>
> ---------- Forwarded message ----------
> From: Ian Kelly <ian.g.kelly at gmail.com>
> To:
> Cc: Python <python-list at python.org>
> Bcc:
> Date: Tue, 24 Oct 2017 15:24:53 -0600
> Subject: Re: Compression of random binary data
> On Tue, Oct 24, 2017 at 12:20 AM, Gregory Ewing
> <greg.ewing at canterbury.ac.nz> wrote:
> > danceswithnumbers at gmail.com wrote:
> >>
> >> I did that quite a while ago. 352,954 kb.
> >
> >
> > Are you sure? Does that include the size of all the
> > code, lookup tables, etc. needed to decompress it?
>
> My bet is that danceswithnumbers does indeed have a file of that size
> which is in some way derived from the million random digits, but
> without any means of losslessly "decompressing" it (thus making it
> junk data).
>
>
>
> ---------- Forwarded message ----------
> From: "Steve D'Aprano" <steve+python at pearwood.info>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 09:11:01 +1100
> Subject: Re: Compression of random binary data
> On Wed, 25 Oct 2017 02:40 am, Lele Gaifax wrote:
>
> > Steve D'Aprano <steve+python at pearwood.info> writes:
> >
> >> But given an empty file, how do you distinguish the empty file you get
> >> from 'music.mp3' and the identical empty file you get from 'movie.avi'?
> >
> > That's simple enough: of course one empty file would be
> > "music.mp3.zip.zip.zip", while the other would be
> > "movie.avi.zip.zip.zip.zip.zip"... some sort of
> > https://en.wikipedia.org/wiki/Water_memory applied to file system
> entries
> > :-)
>
>
> Does that mean if I name an empty file
>
> serenity2-by-joss-whedon.avi.zip.zip.zip.zip.zip
>
> Dancerswithnumbers' magic algorithm will recreate the movie from some
> alternative universe where it actually exists?
>
> Awesome.
>
>
> --
> Steve
> “Cheer up,” they said, “things could be worse.” So I cheered up, and sure
> enough, things got worse.
>
>
>
>
> ---------- Forwarded message ----------
> From: "Steve D'Aprano" <steve+python at pearwood.info>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 09:30:57 +1100
> Subject: Re: Compression of random binary data
> On Wed, 25 Oct 2017 07:09 am, Peter J. Holzer wrote:
>
> > On 2017-10-23 04:21, Steve D'Aprano <steve+python at pearwood.info> wrote:
> >> On Mon, 23 Oct 2017 02:29 pm, Stefan Ram wrote:
> >>>
> >> If the probability of certain codes (either single codes, or sequences
> of
> >> codes) are non-equal, then you can take advantage of that by encoding
> the
> >> common cases into a short representation, and the uncommon and rare
> cases
> >> into a longer representation. As you say:
> >>
> >>
> >>>   Otherwise, if ( 0, 0 ) is much more frequent,
> >>>   we can encode ( 0, 0 ) by "0" and
> >>>
> >>> ( 0, 1 ) by "101",
> >>> ( 1, 0 ) by "110", and
> >>> ( 1, 1 ) by "111".
> >>>
> >>>   And we could then use /less/ than two bits on the
> >>>   average.
> >>
> >> That's incorrect. On average you use 2.5 bits.
> >>
> >> (1*1 bit + 3*3 bits divide by four possible outcomes, makes 2.5 bits.)
> >
> > I disagree. If the distribution is not equal, then the average needs to
> > take the different probabilities into account.
>
> I think I would call that the *weighted* average rather than the average.
>
> Regardless of what we call it, of course both you and Stefan are right in
> how
> to calculate it, and such a variable-length scheme can be used to compress
> the data.
>
> E.g. given the sequence 00000011 which would take 8 bits in the obvious
> encoding, we can encode it as "000111" which takes only 6 bits.
>
> But the cost of this encoding scheme is that *some* bit sequences expand,
> e.g.
> the 8 bit sequence 11111100 is encoded as "1111111110" which requires 10
> bits.
>
> The end result is that averaged over all possible bit sequences (of a
> certain
> size), this encoding scheme requires MORE space than the obvious 0/1 bits.
>
> But in practice we don't care much, because the data sequences we care
> about
> are usually not "all possible bit sequences", but a heavily restricted
> subset
> where there are lots of 00 pairs and fewer 01, 10, and 11 pairs.
>
>
>
> --
> Steve
> “Cheer up,” they said, “things could be worse.” So I cheered up, and sure
> enough, things got worse.
>
>
>
>
> ---------- Forwarded message ----------
> From: Chris Angelico <rosuav at gmail.com>
> To: "python-list at python.org" <python-list at python.org>
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 10:09:42 +1100
> Subject: Re: Compression of random binary data
> On Wed, Oct 25, 2017 at 9:11 AM, Steve D'Aprano
> <steve+python at pearwood.info> wrote:
> > On Wed, 25 Oct 2017 02:40 am, Lele Gaifax wrote:
> >
> >> Steve D'Aprano <steve+python at pearwood.info> writes:
> >>
> >>> But given an empty file, how do you distinguish the empty file you get
> >>> from 'music.mp3' and the identical empty file you get from 'movie.avi'?
> >>
> >> That's simple enough: of course one empty file would be
> >> "music.mp3.zip.zip.zip", while the other would be
> >> "movie.avi.zip.zip.zip.zip.zip"... some sort of
> >> https://en.wikipedia.org/wiki/Water_memory applied to file system
> entries
> >> :-)
> >
> >
> > Does that mean if I name an empty file
> >
> > serenity2-by-joss-whedon.avi.zip.zip.zip.zip.zip
> >
> > Dancerswithnumbers' magic algorithm will recreate the movie from some
> > alternative universe where it actually exists?
> >
> > Awesome.
>
> Yes, but then you'd get
> dmca-takedown-request.pdf.zip.zip.zip.zip.zip.zip.zip which would also
> be empty.
>
> ChrisA
>
>
>
> ---------- Forwarded message ----------
> From: Richard Damon <Richard at damon-family.org>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Tue, 24 Oct 2017 19:15:28 -0400
> Subject: Re: Compression of random binary data
> On 10/24/17 6:30 PM, Steve D'Aprano wrote:
>
>> On Wed, 25 Oct 2017 07:09 am, Peter J. Holzer wrote:
>>
>> On 2017-10-23 04:21, Steve D'Aprano <steve+python at pearwood.info> wrote:
>>>
>>>> On Mon, 23 Oct 2017 02:29 pm, Stefan Ram wrote:
>>>>
>>>>>
>>>>> If the probability of certain codes (either single codes, or sequences
>>>> of
>>>> codes) are non-equal, then you can take advantage of that by encoding
>>>> the
>>>> common cases into a short representation, and the uncommon and rare
>>>> cases
>>>> into a longer representation. As you say:
>>>>
>>>>
>>>>    Otherwise, if ( 0, 0 ) is much more frequent,
>>>>>    we can encode ( 0, 0 ) by "0" and
>>>>>
>>>>> ( 0, 1 ) by "101",
>>>>> ( 1, 0 ) by "110", and
>>>>> ( 1, 1 ) by "111".
>>>>>
>>>>>    And we could then use /less/ than two bits on the
>>>>>    average.
>>>>>
>>>>
>>>> That's incorrect. On average you use 2.5 bits.
>>>>
>>>> (1*1 bit + 3*3 bits divide by four possible outcomes, makes 2.5 bits.)
>>>>
>>>
>>> I disagree. If the distribution is not equal, then the average needs to
>>> take the different probabilities into account.
>>>
>>
>> I think I would call that the *weighted* average rather than the average.
>>
>> Regardless of what we call it, of course both you and Stefan are right in
>> how
>> to calculate it, and such a variable-length scheme can be used to compress
>> the data.
>>
>> E.g. given the sequence 00000011 which would take 8 bits in the obvious
>> encoding, we can encode it as "000111" which takes only 6 bits.
>>
>> But the cost of this encoding scheme is that *some* bit sequences expand,
>> e.g.
>> the 8 bit sequence 11111100 is encoded as "1111111110" which requires 10
>> bits.
>>
>> The end result is that averaged over all possible bit sequences (of a
>> certain
>> size), this encoding scheme requires MORE space than the obvious 0/1 bits.
>>
>> But in practice we don't care much, because the data sequences we care
>> about
>> are usually not "all possible bit sequences", but a heavily restricted
>> subset
>> where there are lots of 00 pairs and fewer 01, 10, and 11 pairs.
>>
>>
> My understanding of the 'Random Data Comprehensibility' challenge is that
> is requires that the compression take ANY/ALL strings of up to N bits, and
> generate an output stream no longer than the input stream, and sometime
> less. It admits that given no-uniformly distributed data, it is possible to
> compress some patterns, the common ones, and expand others, the uncommon
> ones, to lower the net average length. What it says can't be done is to
> have a compression method that compresses EVERY input pattern. That is
> where the 'Pigeon Hole' principle comes into play which the people who
> claim to be able to compress random data like to ignore or just attempt to
> say doesn't apply.
>
>
>
>
> ---------- Forwarded message ----------
> From: C W <tmrsg11 at gmail.com>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Tue, 24 Oct 2017 13:58:48 -0400
> Subject: h5py.File() gives error message
> Dear list,
>
> The following Python code gives an error message
>
> # Python code starts here:
> import numpy as np
> import h5py
> train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r")
>
> # Python code ends
>
> The error message:
>
> train_dataset = h5py.File('train_catvnoncat.h5', "r")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/Users/M/anaconda/lib/python3.6/site-packages/h5py/_hl/files.py",
> line 269, in __init__
>     fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
>   File "/Users/M/anaconda/lib/python3.6/site-packages/h5py/_hl/files.py",
> line 99, in make_fid
>     fid = h5f.open(name, flags, fapl=fapl)
>   File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
>   File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
>   File "h5py/h5f.pyx", line 78, in h5py.h5f.open
> OSError: Unable to open file (unable to open file: name =
> 'train_catvnoncat.h5', errno = 2, error message = 'No such file or
> directory', flags = 0, o_flags = 0)
>
> My directory is correct, and the dataset folder with file is there.
>
> Why error message? Is it h5py.File() or is it my file? Everything seems
> pretty simple, what's going on?
>
> Thank you!
>
>
>
> ---------- Forwarded message ----------
> From: Rob Gaddi <rgaddi at highlandtechnology.invalid>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Tue, 24 Oct 2017 18:02:26 -0700
> Subject: Re: h5py.File() gives error message
> On 10/24/2017 10:58 AM, C W wrote:
>
>> Dear list,
>>
>> The following Python code gives an error message
>>
>> # Python code starts here:
>> import numpy as np
>> import h5py
>> train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r")
>>
>> # Python code ends
>>
>> The error message:
>>
>> train_dataset = h5py.File('train_catvnoncat.h5', "r")
>> Traceback (most recent call last):
>>    File "<stdin>", line 1, in <module>
>>    File "/Users/M/anaconda/lib/python3.6/site-packages/h5py/_hl/
>> files.py",
>> line 269, in __init__
>>      fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
>>    File "/Users/M/anaconda/lib/python3.6/site-packages/h5py/_hl/
>> files.py",
>> line 99, in make_fid
>>      fid = h5f.open(name, flags, fapl=fapl)
>>    File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
>>    File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
>>    File "h5py/h5f.pyx", line 78, in h5py.h5f.open
>> OSError: Unable to open file (unable to open file: name =
>> 'train_catvnoncat.h5', errno = 2, error message = 'No such file or
>> directory', flags = 0, o_flags = 0)
>>
>> My directory is correct, and the dataset folder with file is there.
>>
>> Why error message? Is it h5py.File() or is it my file? Everything seems
>> pretty simple, what's going on?
>>
>> Thank you!
>>
>>
> Be 100% sure your directory is correct.  Try it again with an absolute
> path to the file.  Windows makes it far too easy for the working directory
> of a program to be other than what you think it is.
>
> --
> Rob Gaddi, Highland Technology -- www.highlandtechnology.com
> Email address domain is currently out of order.  See above to fix.
>
>
>
> ---------- Forwarded message ----------
> From: Dennis Lee Bieber <wlfraed at ix.netcom.com>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Tue, 24 Oct 2017 22:35:21 -0400
> Subject: Re: h5py.File() gives error message
> On Tue, 24 Oct 2017 13:58:48 -0400, C W <tmrsg11 at gmail.com> declaimed the
> following:
>
>
> >train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r")
> >
> ># Python code ends
> >
> >The error message:
> >
> >train_dataset = h5py.File('train_catvnoncat.h5', "r")
>
>         This is NOT the same statement you show above.
>
>         So either you are typing things from memory, rather than including
> (cut&paste) the actual lines, or you have multiple files lying around and
> are not executing the version/file you think you are.
> --
>         Wulfraed                 Dennis Lee Bieber         AF6VN
>     wlfraed at ix.netcom.com    HTTP://wlfraed.home.netcom.com/
>
>
>
>
> ---------- Forwarded message ----------
> From: Dennis Lee Bieber <wlfraed at ix.netcom.com>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Tue, 24 Oct 2017 22:37:07 -0400
> Subject: Re: h5py.File() gives error message
> On Tue, 24 Oct 2017 18:02:26 -0700, Rob Gaddi
> <rgaddi at highlandtechnology.invalid> declaimed the following:
>
>         Whoops, I may have gotten the wrong level of quoting -- my
> apologies if
> so (I did have agent fetch the original posting, but might not have had
> that active when I hit "reply")
> --
>         Wulfraed                 Dennis Lee Bieber         AF6VN
>     wlfraed at ix.netcom.com    HTTP://wlfraed.home.netcom.com/
>
>
>
>
> ---------- Forwarded message ----------
> From: ast <nomail at com.invalid>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 08:49:00 +0200
> Subject: Objects with __name__ attribute
> Hi,
>
> I know two Python's objects which have an intrinsic name, classes and
> functions.
>
> def f():
>    pass
>
> f.__name__
>>>>
>>> 'f'
>
>> g = f
>>>> g.__name__
>>>>
>>> 'f'
>
> class Test:
>    pass
>
> Test.__name__
>>>>
>>> 'Test'
>
>> Test2 = Test
>>>> Test2.__name__
>>>>
>>> 'Test'
>
> Are there others objects with a __name__ attribute
> and what is it used for ?
>
> Regards
>
>
>
>
>
>
> ---------- Forwarded message ----------
> From: Peter Otten <__peter__ at web.de>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 09:21:22 +0200
> Subject: Re: Objects with __name__ attribute
> ast wrote:
>
> > Hi,
> >
> > I know two Python's objects which have an intrinsic
> > name, classes and functions.
> >
> > def f():
> >     pass
> >
> >>>> f.__name__
> > 'f'
> >>>> g = f
> >>>> g.__name__
> > 'f'
> >
> > class Test:
> >     pass
> >
> >>>> Test.__name__
> > 'Test'
> >>>> Test2 = Test
> >>>> Test2.__name__
> > 'Test'
> >
> > Are there others objects with a __name__ attribute
> > and what is it used for ?
> >
> > Regards
>
> It was used for the object's repr():
>
> $ python
> Python 2.7.6 (default, Oct 26 2016, 20:30:19)
> [GCC 4.8.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> def f(): pass
> ...
> >>> f.__name__ = "spanish inquisition"
> >>> f
> <function spanish inquisition at 0x7faad26ed7d0>
>
> But this has changed:
>
> $ python3
> Python 3.4.3 (default, Nov 17 2016, 01:08:31)
> [GCC 4.8.4] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> def f(): pass
> ...
> >>> f.__name__ = "spanish inquisition"
> >>> f
> <function f at 0x7f302fc20bf8>
> >>> f.__qualname__ = "spanish inquisition"
> >>> f
> <function spanish inquisition at 0x7f302fc20bf8>
>
> You should be aware that the module name is used to detect the main module:
>
> if __name__ == "__main__":
>     print("this is run as a script")
>
>
>
>
> ---------- Forwarded message ----------
> From: C W <tmrsg11 at gmail.com>
> To: Dennis Lee Bieber <wlfraed at ix.netcom.com>
> Cc: python-list at python.org
> Bcc:
> Date: Wed, 25 Oct 2017 03:21:34 -0400
> Subject: Re: h5py.File() gives error message
> Oh, I was running a debug file, that's why the path is different.
>
> The file is here,
> https://www.dropbox.com/s/6jx4rzyg9xwl95m/train_catvnoncat.h5?dl=0
>
> Is anyone able to get it working? Thank you!
>
> On Tue, Oct 24, 2017 at 10:37 PM, Dennis Lee Bieber <wlfraed at ix.netcom.com
> >
> wrote:
>
> > On Tue, 24 Oct 2017 18:02:26 -0700, Rob Gaddi
> > <rgaddi at highlandtechnology.invalid> declaimed the following:
> >
> >         Whoops, I may have gotten the wrong level of quoting -- my
> > apologies if
> > so (I did have agent fetch the original posting, but might not have had
> > that active when I hit "reply")
> > --
> >         Wulfraed                 Dennis Lee Bieber         AF6VN
> >     wlfraed at ix.netcom.com    HTTP://wlfraed.home.netcom.com/
> >
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
>
>
>
> ---------- Forwarded message ----------
> From: Gregory Ewing <greg.ewing at canterbury.ac.nz>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 20:32:11 +1300
> Subject: Re: Compression of random binary data
> Steve D'Aprano wrote:
>
>> - Encrypted data looks very much like random noise.
>>
>
> There's actually a practical use for that idea. If you can feed
> the output of an encryption algorithm through a compressor and
> make it smaller, it means there is a cryptographic weakness
> in the algorithm that could potentially be exploited. Good
> encryption algorithms produce output that looks almost completely
> random to anyone who doesn't know how to decrypt it.
>
> --
> Greg
>
>
>
> ---------- Forwarded message ----------
> From: Gregory Ewing <greg.ewing at canterbury.ac.nz>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 21:11:25 +1300
> Subject: Re: Compression of random binary data
> Ben Bacarisse wrote:
>
>> The trouble is a pedagogic one.  Saying "you can't compress random data"
>> inevitably leads (though, again, this is just my experience) to endless
>> attempts to define random data.
>>
>
> It's more about using terms without making sure everyone agrees
> on the definitions being used.
>
> In this context, "random data" really means "uniformly distributed
> data", i.e. any bit sequence is equally likely to be presented as
> input. *That's* what information theory says can't be compressed.
>
> I think "arbitrary data" (thereby including the results of compression
>> by said algorithm) is the best way to make progress.
>>
>
> I'm not sure that's much better, because it doesn't home in
> on the most important thing, which is the probability
> distribution.
>
> --
> Greg
>
>
>
> ---------- Forwarded message ----------
> From: Gregory Ewing <greg.ewing at canterbury.ac.nz>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 21:25:07 +1300
> Subject: Re: Compression of random binary data
> Lele Gaifax wrote:
>
>> That's simple enough: of course one empty file would be
>> "music.mp3.zip.zip.zip", while the other would be
>> "movie.avi.zip.zip.zip.zip.zip"... some sort of
>> https://en.wikipedia.org/wiki/Water_memory applied to file system
>> entries :-)
>>
>
> If you're allowed to alternate between two compression
> methods, then the way you decompress
> music.mp3.zip.zip.tgz.zip...........tgz.zip.tgz
> is to output 0 each time zip was applied and 1 each
> time tar/gz was applied.
>
> You may be able to take some shortcuts in some
> cases, e.g. anything beginning with "movie.flv"
> almost certainly contains a cute kitten video.
> (Unless it's found inside an encrypted disk
> partition, in which case it contains porn.)
>
> --
> Greg
>
>
>
> ---------- Forwarded message ----------
> From: Cameron Simpson <cs at cskk.id.au>
> To: T Obulesu <obulesu.t at gmail.com>
> Cc: python-list at python.org
> Bcc:
> Date: Wed, 25 Oct 2017 16:10:02 +1100
> Subject: Re: Sockets but calling from different programs
> On 23Oct2017 05:33, T Obulesu <obulesu.t at gmail.com> wrote:
>
>> I'm new to python3 and scratching my head to write a program for this
>> logic:
>>
>
> The tutor list might be a better place for such questions, but since we're
> here...
>
> classA.py
>> Class A:
>>          # class for socket communication
>>          basic init method that initializes port, address, connection
>>         method send(message):
>>         # for sending any message through the given port
>>       method receive():
>>       # will be keep on listening for incoming messages
>>
>> classB.py
>> Class B:
>>           import the send method from class A
>>           send the messages from this class
>>
>> classC.py
>> Class C:
>>            import the receive method from the class A
>>            receive all the messages from the same socket from here.
>>
>> Note:
>> classA.py, classB.py, ClassC.py are saved in different locations.
>>
>> Can someone help me in writing the code and how can I create a single
>> object and use it in multiple classed?
>>
>
> That is a pretty normal arrangement. Class A might look like this:
>
>  class A:
>    def __init__(self, port, address):
>      self.connection = ... make your connection to (address, port)
>    def send(self, msg):
>      send msg using self.connection ...
>
> Since classes B and C seem expected to share tha same connection, the
> natural thing is to set up the connection _separately_ from setting up B
> and C, and pass the established connection to each.
>
> So class B might commence:
>
>  class B:
>    def __init__(self, conn, ...):
>      self.conn = conn
>      ... whatever other initialisation ...
>    def speak(self, something):
>      self.conn.send(something)
>
> You'll notice here that we're _not_ importing anything about class A
> here.  Class B does not need to know class A's name to use it.
>
> Because Python uses duck typing, you could pass _any_ object which has a
> .send() method as "conn" to the class B setup. This allows you to write
> some other class A2 with those same methods, but using some different type
> of connection, and pass that in to classes B and C.
>
> So a main programme might set things up like this:
>
>  from classA import A
>  from classB import B
>  from classC import C
>
>  conn = A(address, port)
>  sender = B(conn, other-stuff...)
>  receiver = C(conn, other-stuff...)
>  B.speak("foo")
>
> and so forth.
>
> Cheers,
> Cameron Simpson <cs at cskk.id.au> (formerly cs at zip.com.au)
>
>
>
> ---------- Forwarded message ----------
> From: Peter Otten <__peter__ at web.de>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 11:20:56 +0200
> Subject: Re: h5py.File() gives error message
> C W wrote:
>
> > Oh, I was running a debug file, that's why the path is different.
> >
> > The file is here,
> > https://www.dropbox.com/s/6jx4rzyg9xwl95m/train_catvnoncat.h5?dl=0
> >
> > Is anyone able to get it working? Thank you!
>
> Hm, that file seems to contain HTML and that causes an OSError here, too:
>
> $ head -n3 datasets/train_catvnoncat.h5
>
> <!DOCTYPE HTML>
> <html>
>
> $ python3
> Python 3.4.3 (default, Nov 17 2016, 01:08:31)
> [GCC 4.8.4] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import h5py
> >>> train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/python3/dist-packages/h5py/_hl/files.py", line 207, in
> __init__
>     fid = make_fid(name, mode, userblock_size, fapl)
>   File "/usr/lib/python3/dist-packages/h5py/_hl/files.py", line 79, in
> make_fid
>     fid = h5f.open(name, h5f.ACC_RDONLY, fapl=fapl)
>   File "h5f.pyx", line 71, in h5py.h5f.open (h5py/h5f.c:1806)
> OSError: unable to open file (File accessibilty: Unable to open file)
>
> It's not exactly what you see, but that may be due to differing software
> versions.
> When I replace the HTML file with its namesake found at
>
> https://github.com/lalxyy/NEU-MCM-Training-4/blob/master/
> code/datasets/train_catvnoncat.h5
>
> I can open it:
>
> $ file datasets/train_catvnoncat.h5
> datasets/train_catvnoncat.h5: Hierarchical Data Format (version 5) data
>
> $ python3
> Python 3.4.3 (default, Nov 17 2016, 01:08:31)
> [GCC 4.8.4] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import h5py
> >>> train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r")
> >>>
>
>
>
>
> ---------- Forwarded message ----------
> From: Karsten Hilbert <Karsten.Hilbert at gmx.net>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 11:51:07 +0200
> Subject: Re: right list for SIGABRT python binary question ?
> On Tue, Oct 24, 2017 at 08:47:58PM +0200, M.-A. Lemburg wrote:
>
> > >> This error suggests that you have 32- and 64-bit versions of
> > >> Python and mxDateTime mixed in your installation.
> > >>
> > >> Py_InitModule4 is only available in the 32-bit build of
> > >> Python. With the 64-bit build, it's called Py_InitModule4_64.
> ...
> > Could you check whether you have similar import errors with
> > other modules that have C extensions ? E.g. lxml.
> >
> > What you're seeing appears to be a compilation problem
> > with Python 2.7.14 on Debian. The executable doesn't appear
> > to export its symbols to the .so files, or only some of them.
>
> Let's see:
>
>         python-lxml:
>           Installiert:           4.0.0-1
>           Installationskandidat: 4.0.0-1
>           Versionstabelle:
>          *** 4.0.0-1 990
>                 990 http://httpredir.debian.org/debian buster/main i386
> Packages
>                 500 http://httpredir.debian.org/debian unstable/main i386
> Packages
>                 100 /var/lib/dpkg/status
>              3.7.1-1 500
>                 500 http://httpredir.debian.org/debian stretch/main i386
> Packages
>         python-lxml-dbg:
>           Installiert:           (keine)
>           Installationskandidat: 4.0.0-1
>           Versionstabelle:
>              4.0.0-1 990
>                 990 http://httpredir.debian.org/debian buster/main i386
> Packages
>                 500 http://httpredir.debian.org/debian unstable/main i386
> Packages
>              3.7.1-1 500
>                 500 http://httpredir.debian.org/debian stretch/main i386
> Packages
>
>
>         ncq at hermes:~$ python2.7-dbg
>         Python 2.7.14 (default, Sep 17 2017, 18:50:44)
>         [GCC 7.2.0] on linux2
>         Type "help", "copyright", "credits" or "license" for more
> information.
>         >>> import lxml
>         [45350 refs]
>         >>>
>
>         ncq at hermes:~$ python
>         Python 2.7.14 (default, Sep 17 2017, 18:50:44)
>         [GCC 7.2.0] on linux2
>         Type "help", "copyright", "credits" or "license" for more
> information.
>         >>> import lxml
>         >>>
>
> Also, psycogp2 imports just fine.
>
> Now that I have
>
>         python-egenix-mx-base-dbg:
>           Installiert:           3.2.9-1
>           Installationskandidat: 3.2.9-1
>           Versionstabelle:
>          *** 3.2.9-1 990
>                 500 http://httpredir.debian.org/debian stretch/main i386
> Packages
>                 990 http://httpredir.debian.org/debian buster/main i386
> Packages
>                 500 http://httpredir.debian.org/debian unstable/main i386
> Packages
>                 100 /var/lib/dpkg/status
>
> mx.DateTime imports fine as well (but the SIGABRT persists).
>
> Karsten
> --
> GPG key ID E4071346 @ eu.pool.sks-keyservers.net
> E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346
>
>
>
> ---------- Forwarded message ----------
> From: Thomas Jollans <tjol at tjol.eu>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 15:07:24 +0200
> Subject: Let's talk about debuggers!
> Hi,
>
> I just wanted to know what tools everyone used for debugging Python
> applications - scripts / backend / desktop apps / notebooks / whatever.
> Apart from the usual dance with log files and strategically inserted
> print() calls, that is.
>
> Of course we all know and mildly dislike pdb.
>
> Personally, in practice, I'm most likely to need a debugger when
> prototyping a function in a Jupyter notebook. There, ipdb, summoned with
> the %%debug magic incantation, does the trick.
>
> Sometimes, though, I miss having a visual debugger. You know, the kind
> that Visual Basic has had for decades. There's one in Chrome dev tools
> if you ever have the misfortune of writing JavaScript.
>
> What options are there for Python (that work)? What text editors (and
> IDEs) have a decent integrated debugger or debugging plugin? (Is there
> anything for Sublime?) Does anyone use them? (How do YOU debug?)
>
> I vaguely remember WinPDB, but that hasn't seen a release in more than
> seven years...
>
>
> --
> Thomas Jollans
>
>
>
> ---------- Forwarded message ----------
> From: Ian Kelly <ian.g.kelly at gmail.com>
> To:
> Cc: python-list at python.org
> Bcc:
> Date: Wed, 25 Oct 2017 07:27:59 -0600
> Subject: Re: Compression of random binary data
> On 10/24/17, Richard Damon <Richard at damon-family.org> wrote:
> > My understanding of the 'Random Data Comprehensibility' challenge is
> > that is requires that the compression take ANY/ALL strings of up to N
> > bits, and generate an output stream no longer than the input stream, and
> > sometime less.
>
> That's incorrect, at least of the challenge being discussed. Here's the
> link:
>
> http://marknelson.us/2012/10/09/the-random-compression-
> challenge-turns-ten/
>
> The challenge is just to take a single known file of a million random
> digits and make it smaller, including the size of the decompresser and
> without hiding data. So far in 15 years nobody has succeeded even at
> this, and nobody knows whether it's impossible. For instance it may be
> the case that the data in the file happens to be the nth prime, in
> which case it could simply be compressed to the number n with a
> decompresser that calculates process.
>
> > It admits that given no-uniformly distributed data, it is
> > possible to compress some patterns, the common ones, and expand others,
> > the uncommon ones, to lower the net average length. What it says can't
> > be done is to have a compression method that compresses EVERY input
> > pattern. That is where the 'Pigeon Hole' principle comes into play which
> > the people who claim to be able to compress random data like to ignore
> > or just attempt to say doesn't apply.
>
> There is a second challenge on that page that is as you state, but the
> page admits that this second challenge is a bit of a troll since this
> is provably impossible.
>
>
>
> ---------- Forwarded message ----------
> From: Fabien <fabien.maussion at gmail.com>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 15:31:21 +0200
> Subject: Re: Let's talk about debuggers!
> On 10/25/2017 03:07 PM, Thomas Jollans wrote:
>
>> What options are there for Python (that work)?
>>
>
> PyCharm's debugger is fine (also available in the community edition)
>
> Cheers,
>
> Fabien
>
>
>
> ---------- Forwarded message ----------
> From: C W <tmrsg11 at gmail.com>
> To: Peter Otten <__peter__ at web.de>
> Cc: python-list at python.org
> Bcc:
> Date: Wed, 25 Oct 2017 09:58:20 -0400
> Subject: Re: h5py.File() gives error message
> wow, thanks so much! I don't know how you figured that it's HTML, but
> that's awesome!
>
> Mike
>
> On Wed, Oct 25, 2017 at 5:20 AM, Peter Otten <__peter__ at web.de> wrote:
>
> > C W wrote:
> >
> > > Oh, I was running a debug file, that's why the path is different.
> > >
> > > The file is here,
> > > https://www.dropbox.com/s/6jx4rzyg9xwl95m/train_catvnoncat.h5?dl=0
> > >
> > > Is anyone able to get it working? Thank you!
> >
> > Hm, that file seems to contain HTML and that causes an OSError here, too:
> >
> > $ head -n3 datasets/train_catvnoncat.h5
> >
> > <!DOCTYPE HTML>
> > <html>
> >
> > $ python3
> > Python 3.4.3 (default, Nov 17 2016, 01:08:31)
> > [GCC 4.8.4] on linux
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import h5py
> > >>> train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r")
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in <module>
> >   File "/usr/lib/python3/dist-packages/h5py/_hl/files.py", line 207, in
> > __init__
> >     fid = make_fid(name, mode, userblock_size, fapl)
> >   File "/usr/lib/python3/dist-packages/h5py/_hl/files.py", line 79, in
> > make_fid
> >     fid = h5f.open(name, h5f.ACC_RDONLY, fapl=fapl)
> >   File "h5f.pyx", line 71, in h5py.h5f.open (h5py/h5f.c:1806)
> > OSError: unable to open file (File accessibilty: Unable to open file)
> >
> > It's not exactly what you see, but that may be due to differing software
> > versions.
> > When I replace the HTML file with its namesake found at
> >
> > https://github.com/lalxyy/NEU-MCM-Training-4/blob/master/cod
> > e/datasets/train_catvnoncat.h5
> >
> > I can open it:
> >
> > $ file datasets/train_catvnoncat.h5
> > datasets/train_catvnoncat.h5: Hierarchical Data Format (version 5) data
> >
> > $ python3
> > Python 3.4.3 (default, Nov 17 2016, 01:08:31)
> > [GCC 4.8.4] on linux
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import h5py
> > >>> train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r")
> > >>>
> >
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
>
>
>
> ---------- Forwarded message ----------
> From: Rustom Mody <rustompmody at gmail.com>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 06:57:04 -0700 (PDT)
> Subject: Re: Let's talk about debuggers!
> On Wednesday, October 25, 2017 at 6:37:47 PM UTC+5:30, Thomas Jollans
> wrote:
> > Hi,
> >
> > I just wanted to know what tools everyone used for debugging Python
> > applications - scripts / backend / desktop apps / notebooks / whatever.
> > Apart from the usual dance with log files and strategically inserted
> > print() calls, that is.
> >
> > Of course we all know and mildly dislike pdb.
> >
> > Personally, in practice, I'm most likely to need a debugger when
> > prototyping a function in a Jupyter notebook. There, ipdb, summoned with
> > the %%debug magic incantation, does the trick.
> >
> > Sometimes, though, I miss having a visual debugger. You know, the kind
> > that Visual Basic has had for decades. There's one in Chrome dev tools
> > if you ever have the misfortune of writing JavaScript.
> >
> > What options are there for Python (that work)? What text editors (and
> > IDEs) have a decent integrated debugger or debugging plugin? (Is there
> > anything for Sublime?) Does anyone use them? (How do YOU debug?)
> >
> > I vaguely remember WinPDB, but that hasn't seen a release in more than
> > seven years...
>
> pdb inside emacs works (to a fashion)
> And it shows the arrow for current line so its at least quasi-gui
>
> I believe idle too is much more usable than a few years earlier
>
>
>
> ---------- Forwarded message ----------
> From: Ned Batchelder <ned at nedbatchelder.com>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 09:53:10 -0400
> Subject: Re: Let's talk about debuggers!
> On 10/25/17 9:07 AM, Thomas Jollans wrote:
>
>> Hi,
>>
>> I just wanted to know what tools everyone used for debugging Python
>> applications - scripts / backend / desktop apps / notebooks / whatever.
>> Apart from the usual dance with log files and strategically inserted
>> print() calls, that is.
>>
>> Of course we all know and mildly dislike pdb.
>>
>> Personally, in practice, I'm most likely to need a debugger when
>> prototyping a function in a Jupyter notebook. There, ipdb, summoned with
>> the %%debug magic incantation, does the trick.
>>
>> Sometimes, though, I miss having a visual debugger. You know, the kind
>> that Visual Basic has had for decades. There's one in Chrome dev tools
>> if you ever have the misfortune of writing JavaScript.
>>
>> What options are there for Python (that work)? What text editors (and
>> IDEs) have a decent integrated debugger or debugging plugin? (Is there
>> anything for Sublime?) Does anyone use them? (How do YOU debug?)
>>
>> I vaguely remember WinPDB, but that hasn't seen a release in more than
>> seven years...
>>
>>
>>
> pudb is a visual terminal debugger: https://pypi.python.org/pypi/pudb
>
> It uses the same commands as pdb, so it's easy to get started, but it
> gives you a variables pane, with customizable presentation, and so on.
>
> One of my favorite features: you can add a set_trace line in your program,
> and then if during the debugging session you realize you don't want to stop
> there every time, you can disable that breakpoint even though it's an
> explicit line of code telling the debugger to stop.
>
> --Ned.
>
>
>
> ---------- Forwarded message ----------
> From: Michele Simionato <michele.simionato at gmail.com>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 07:08:31 -0700 (PDT)
> Subject: Re: Let's talk about debuggers!
> pdb plus plus: https://pypi.python.org/pypi/pdbpp
>
>
>
> ---------- Forwarded message ----------
> From: Bill <BILL_NOSPAM at whoknows.net>
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 10:46:47 -0400
> Subject: Re: Let's talk about debuggers!
> Fabien wrote:
>
>> On 10/25/2017 03:07 PM, Thomas Jollans wrote:
>>
>>> What options are there for Python (that work)?
>>>
>>
>> PyCharm's debugger is fine (also available in the community edition)
>>
> +1
>
>
>> Cheers,
>>
>> Fabien
>>
>
>
>
>
> ---------- Forwarded message ----------
> From: danceswithnumbers at gmail.com
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 07:49:34 -0700 (PDT)
> Subject: Re: Compression of random binary data
> Whatever you do, you'll find that *on average* you
> will need *at least* 34 bits to be able to represent
> all possible 10-digit decimal numbers. Some might
> be shorter, but then others will be longer, and
> the average won't be less than 34.
>
>
> The theoretical limit for arbitrary numbers 0 - 9 must be viewed as an
> average not as an impossibility to, in some cases be able to compress to or
> under 34. This is obvious by the decimal to binary function.
>
>
>
> ---------- Forwarded message ----------
> From: William Ray Wing <wrw at mac.com>
> To: Thomas Jollans <tjol at tjol.eu>
> Cc: "William R. Wing" <wrw at mac.com>, python-list at python.org
> Bcc:
> Date: Wed, 25 Oct 2017 10:30:28 -0400
> Subject: Re: Let's talk about debuggers!
>
> > On Oct 25, 2017, at 9:07 AM, Thomas Jollans <tjol at tjol.eu> wrote:
> >
> >
>
> [byte]
>
> > What options are there for Python (that work)? What text editors (and
> > IDEs) have a decent integrated debugger or debugging plugin?
>
> I rather like WingIDE (the name is a coincidence).  It allows
> insertion/removal of break points while the code is running.  While
> execution is stopped, it allows direct inspection of the stack (no
> surprise), but in addition allows execution of python statements or program
> elements typed into an auxiliary window - including importing things like
> matplotlib and plotting the current state of data arrays.  Its editor is
> syntax-aware and highlights accidental syntax errors as they are typed.
> Lots of other features, those just happen to be the ones I use most often.
>
> Bill
>
>
> ---------- Forwarded message ----------
> From: kkgsrkmk at gmail.com
> To: python-list at python.org
> Cc:
> Bcc:
> Date: Wed, 25 Oct 2017 08:46:59 -0700 (PDT)
> Subject: Test Bank for Campbell Biology 11th Edition by Urry, Cain
> Where it didnt come
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
>



More information about the Python-list mailing list