Re: How to debug an unfired tkinter event?

2017-10-19 Thread Terry Reedy
On 10/19/2017 11:28 PM, jf...@ms4.hinet.net wrote: Terry Reedy於 2017年10月20日星期五 UTC+8上午7時37分59秒寫道: On 10/19/2017 5:07 AM, jf...@ms4.hinet.net wrote: I got some info below each time when I squeeze the table: . .5006 .5006.50712528 .5006.50712496 .5006.50712464 .5006.50712144

Re: How to debug an unfired tkinter event?

2017-10-19 Thread jfong
Terry Reedy於 2017年10月20日星期五 UTC+8上午7時37分59秒寫道: > On 10/19/2017 5:07 AM, jf...@ms4.hinet.net wrote: > > > I got some info below each time when I squeeze the table: > > . > > .5006 > > .5006.50712528 > > .5006.50712496 > > .5006.50712464 > > .5006.50712144 > > .5006.50712528.

Re: How to debug an unfired tkinter event?

2017-10-19 Thread jfong
Peter Otten於 2017年10月20日星期五 UTC+8上午4時37分10秒寫道: > jf...@ms4.hinet.net wrote: > > > Peter Otten於 2017年10月19日星期四 UTC+8下午6時04分39秒寫道: > >> jf...@ms4.hinet.net wrote: > >> > >> > Peter Otten at 2017-10-19 UTC+8 PM 3:24:30 wrote: > >> >> It's not clear to me what you mean with this. Did you place the ta

Re: Efficient counting of results

2017-10-19 Thread MRAB
On 2017-10-20 03:32, Chris Angelico wrote: On Fri, Oct 20, 2017 at 12:18 PM, Steve D'Aprano wrote: On Fri, 20 Oct 2017 05:28 am, Israel Brewster wrote: So if the date of the first record was today, t1 was on-time, and t2 was 5 minutes late, then I would need to increment ALL of the following (

Re: Efficient counting of results

2017-10-19 Thread Chris Angelico
On Fri, Oct 20, 2017 at 12:18 PM, Steve D'Aprano wrote: > On Fri, 20 Oct 2017 05:28 am, Israel Brewster wrote: >> So if the date of >> the first record was today, t1 was on-time, and t2 was 5 minutes late, then >> I would need to increment ALL of the following (using your data structure >> from ab

Re: Efficient counting of results

2017-10-19 Thread Steve D'Aprano
On Fri, 20 Oct 2017 05:28 am, Israel Brewster wrote: > If it helps, my data would look something like this: > > [ (date, key, t1, t2), > (date, key, t1, t2) > . > . > ] > > Where the date and the key are what is used to determine what "on-time" is > for the record, and thus which "late" bin to

Re: Application and package of the same name

2017-10-19 Thread Skip Montanaro
Have you toyed with "from __future__ import absolute_import" ? Not sure if it'd help or not, but worth a try. Yeah, I did, but it didn't change anything as far as I could tell. S -- https://mail.python.org/mailman/listinfo/python-list

Re: Application and package of the same name

2017-10-19 Thread Chris Angelico
On Fri, Oct 20, 2017 at 7:09 AM, Skip Montanaro wrote: >> My immediate reaction is "you shouldn't name your main program and >> your package the same". It's not a pattern I've seen commonly used. >> >> However, the approaches I've seen used (a __main__.py inside the >> package, so you can execute

Re: How to debug an unfired tkinter event?

2017-10-19 Thread Terry Reedy
On 10/19/2017 5:07 AM, jf...@ms4.hinet.net wrote: I got some info below each time when I squeeze the table: . .5006 .5006.50712528 .5006.50712496 .5006.50712464 .5006.50712144 .5006.50712528.50712560.50782256 .5006.50712528.50712560.50782256.50783024 .5006.5071252

Re: Problem with StreamReaderWriter on 3.6.3?

2017-10-19 Thread MRAB
On 2017-10-19 22:46, Peter via Python-list wrote: I came across this code in Google cpplint.py, a Python script for linting C++ code. I was getting funny results with Python 3.6.3, but it worked fine under 2.7.13 I've tracked the problem to an issue with StreamReaderWriter; the traceback and err

Problem with StreamReaderWriter on 3.6.3?

2017-10-19 Thread Peter via Python-list
I came across this code in Google cpplint.py, a Python script for linting C++ code. I was getting funny results with Python 3.6.3, but it worked fine under 2.7.13 I've tracked the problem to an issue with StreamReaderWriter; the traceback and error never shows under 3. The _cause_ of the error

Re: How to debug an unfired tkinter event?

2017-10-19 Thread Peter Otten
jf...@ms4.hinet.net wrote: > Peter Otten於 2017年10月19日星期四 UTC+8下午6時04分39秒寫道: >> jf...@ms4.hinet.net wrote: >> >> > Peter Otten at 2017-10-19 UTC+8 PM 3:24:30 wrote: >> >> It's not clear to me what you mean with this. Did you place the table >> >> from the recipe elsewhere inside a window that you

Re: Application and package of the same name

2017-10-19 Thread Skip Montanaro
> My immediate reaction is "you shouldn't name your main program and > your package the same". It's not a pattern I've seen commonly used. > > However, the approaches I've seen used (a __main__.py inside the > package, so you can execute it via `python -m fribble`, or a setup.py > entry point to ge

Re: Efficient counting of results

2017-10-19 Thread Thomas Jollans
On 19/10/17 20:04, Israel Brewster wrote: >> then loop through the records, find the schedule for that record (if any, if >> not move on as mentioned earlier), compare t1 and t2 against the schedule, >> and increment the appropriate bin counts using a bunch of if statements. >> Functional, if ug

Re: Efficient counting of results

2017-10-19 Thread Peter Otten
Israel Brewster wrote: > >> On Oct 19, 2017, at 10:02 AM, Stefan Ram wrote: >> >> Israel Brewster writes: >>> t10 = {'daily': 0, 'WTD': 0, 'MTD': 0, 'YTD': 0,} >>> increment the appropriate bin counts using a bunch of if statements. >> >> I can't really completely comprehend your requirement

Re: Application and package of the same name

2017-10-19 Thread Paul Moore
On 19 October 2017 at 19:18, Skip Montanaro wrote: > I'm not understanding something fundamental about absolute/relative > imports. Suppose I have an application, fribble.py, and it has a > corresponding package full of goodies it relies on, also named fribble. > From the fribble package, the appl

Re: Efficient counting of results

2017-10-19 Thread Israel Brewster
> On Oct 19, 2017, at 10:02 AM, Stefan Ram wrote: > > Israel Brewster writes: >> t10 = {'daily': 0, 'WTD': 0, 'MTD': 0, 'YTD': 0,} >> increment the appropriate bin counts using a bunch of if statements. > > I can't really completely comprehend your requirements > specification, you might hav

Vim, ctags jump to python standard library source

2017-10-19 Thread Matt Schepers
I prefer to use vim and ctags when developing python, but I'm having trouble getting ctags to index the standard library. Sometimes I would like to see an object's constructor etc... Does anyone know how to do this? Thanks -- https://mail.python.org/mailman/listinfo/python-list

make test on Centos 7.4 fails

2017-10-19 Thread Decker, Ryan C.
Hey Python guys, test_socket doesn't seem to be passing on a clean CentOS 7.4 install. strace -s 128 -e trace=%network -o trace ./python -m test -v test_socket -m test_sha256 == CPython 3.6.3 (default, Oct 19 2017, 14:12:01) [GCC 7.1.1 20170526 (Red Hat 7.1.1-2)] == Linux-3.10.0-693.2.2.el7.x86_6

Application and package of the same name

2017-10-19 Thread Skip Montanaro
I'm not understanding something fundamental about absolute/relative imports. Suppose I have an application, fribble.py, and it has a corresponding package full of goodies it relies on, also named fribble. >From the fribble package, the application wants to import the sandwich function from the lunc

Re: Efficient counting of results

2017-10-19 Thread Israel Brewster
> On Oct 19, 2017, at 9:40 AM, Israel Brewster wrote: > > I am working on developing a report that groups data into a two-dimensional > array based on date and time. More specifically, date is grouped into > categories: > > day, week-to-date, month-to-date, and year-to-date > > Then, for eac

Re: right list for SIGABRT python binary question ?

2017-10-19 Thread Karsten Hilbert
On Thu, Oct 19, 2017 at 07:27:45PM +0200, Karsten Hilbert wrote: > I am currently running the bootstrapper with mxdatetime as a > dbg build to see what gives. The only other C extension I am > aware of that is in use is psycopg2. So here's the final console output of that: ==> bootstrapp

Efficient counting of results

2017-10-19 Thread Israel Brewster
I am working on developing a report that groups data into a two-dimensional array based on date and time. More specifically, date is grouped into categories: day, week-to-date, month-to-date, and year-to-date Then, for each of those categories, I need to get a count of records that fall into t

Re: efficient way to get a sufficient set of identifying attributes

2017-10-19 Thread Chris Angelico
On Fri, Oct 20, 2017 at 4:21 AM, Stefan Ram wrote: > Dennis Lee Bieber writes: >>Interesting -- that is coming out to be 2^size - 1, which will sure speed >>up calculation for larger sets rather than doing all the factorial stuff. > > A set of size n has 2^n subsets. > > We exclude the empty

Re: right list for SIGABRT python binary question ?

2017-10-19 Thread Karsten Hilbert
On Wed, Oct 18, 2017 at 02:07:46PM +0200, Thomas Jollans wrote: > > When run under a debug build it sayeth right away (simulated > > as a minimal working example): > > > > root@hermes:~/bin# python2.7-dbg > > Python 2.7.14 (default, Sep 17 2017, 18:50:44) > > [GCC 7.2.0] o

Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-19 Thread Daniel Flick
The problem was with the validation code. Within the python section of the template, the class IPv4Interface will throw an exception due to the invalid value during the validation process. Therefore, the server rejects the form data and the template is not created. Solution: It would work if y

Re: efficient way to get a sufficient set of identifying attributes

2017-10-19 Thread Robin Becker
On 19/10/2017 16:42, Stefan Ram wrote: Robin Becker writes: Presumably the information in any attribute is highest if the number of distinct occurrences is the the same as the list length and pairs of attributes are more likely to be unique, but is there some proper way

Re: What happens when a __call__ function is defined in both class and object ?

2017-10-19 Thread Thomas Jollans
On 2017-10-19 10:11, ast wrote: > Surprisingly, __call__ from the class is called, not the > one defined in the object. Why ? That's just how dunder methods like __call__ work. See https://docs.python.org/3/reference/datamodel.html#special-method-names To quote the docs: > For instance, if a cl

efficient way to get a sufficient set of identifying attributes

2017-10-19 Thread Robin Becker
Given a list of objects with attributes a0, a1, a2,an-1 is there an efficient way to find sets of attributes which can be used to distinguish members of the list? As example a list of people might have firstName, lastName, nationality, postcode, phonenumber, as attributes. The probe i

Re: How to debug an unfired tkinter event?

2017-10-19 Thread jfong
Peter Otten於 2017年10月19日星期四 UTC+8下午6時04分39秒寫道: > jf...@ms4.hinet.net wrote: > > > Peter Otten at 2017-10-19 UTC+8 PM 3:24:30 wrote: > >> It's not clear to me what you mean with this. Did you place the table > >> from the recipe elsewhere inside a window that you created or did you > >> make change

Re: How to debug an unfired tkinter event?

2017-10-19 Thread Peter Otten
jf...@ms4.hinet.net wrote: > Peter Otten at 2017-10-19 UTC+8 PM 3:24:30 wrote: >> It's not clear to me what you mean with this. Did you place the table >> from the recipe elsewhere inside a window that you created or did you >> make changes in the recipe's code? > > Thank you, Peter. I am using P

Re: How to debug an unfired tkinter event?

2017-10-19 Thread jfong
Peter Otten at 2017-10-19 UTC+8 PM 3:24:30 wrote: > It's not clear to me what you mean with this. Did you place the table from > the recipe elsewhere inside a window that you created or did you make > changes in the recipe's code? Thank you, Peter. I am using Python 3.4.4 under WinXP. When run

Re: What happens when a __call__ function is defined in both class and object ?

2017-10-19 Thread Chris Angelico
On Thu, Oct 19, 2017 at 7:24 PM, Chris Angelico wrote: > On Thu, Oct 19, 2017 at 7:11 PM, ast wrote: >> Hello, please have a look at following code snippet >> (python 3.4.4) >> >> class Test: >> >>a = 1 >> >>def __init__(self): >>self.a = 2 >>self.f = lambda : print("f fro

Re: What happens when a __call__ function is defined in both class and object ?

2017-10-19 Thread Chris Angelico
On Thu, Oct 19, 2017 at 7:11 PM, ast wrote: > Hello, please have a look at following code snippet > (python 3.4.4) > > class Test: > >a = 1 > >def __init__(self): >self.a = 2 >self.f = lambda : print("f from object") >self.__call__ = lambda : print("__call__ from ob

What happens when a __call__ function is defined in both class and object ?

2017-10-19 Thread ast
Hello, please have a look at following code snippet (python 3.4.4) class Test: a = 1 def __init__(self): self.a = 2 self.f = lambda : print("f from object") self.__call__ = lambda : print("__call__ from object") def __call__(self): print("__call__ from cl

Re: How to debug an unfired tkinter event?

2017-10-19 Thread Peter Otten
jf...@ms4.hinet.net wrote: > In last few days, I tried to experiment with the scrolling table > implemented in canvas, started from this example: > http://code.activestate.com/recipes/580793-tkinter-table-with-scrollbars/. > Everything works fine until I moved the scrolling_area instance (which th