Re: Win32 API in pywin32

2016-08-12 Thread Lawrence D’Oliveiro
On Friday, August 5, 2016 at 11:58:05 AM UTC+12, I wrote: > > Are people still using Win32? I thought Windows went 64-bit years ago. Here is a little titbit I was looking for: Win32 has a function for getting the size o

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread Lawrence D’Oliveiro
On Saturday, August 13, 2016 at 2:33:55 PM UTC+12, bream...@gmail.com wrote: >> Surely this application was built using a build system, even back then, >> that would allow compilation to resume and not rebuild object files that >> were already built. > > Are you one of those extremely lucky people

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread breamoreboy
On Friday, August 12, 2016 at 2:31:01 PM UTC+1, Michael Torrie wrote: > On 08/12/2016 05:07 AM, Steven D'Aprano wrote: > > The first time I ever compiled a full-sized application (not a particular > > large one either, it was a text editor a little more featureful than > > Notepad) it took somethin

Re: Why my image cannot be displayed?

2016-08-12 Thread MRAB
On 2016-08-13 02:40, huey.y.ji...@gmail.com wrote: Hi All, Image display drives me crazy. After I get it displayed, and want to do the job with a class, display failed again. Please take a look at my trial code: from Tkinter import * class imageDisplay: def __init__(self, parent=None)

Why my image cannot be displayed?

2016-08-12 Thread huey . y . jiang
Hi All, Image display drives me crazy. After I get it displayed, and want to do the job with a class, display failed again. Please take a look at my trial code: from Tkinter import * class imageDisplay: def __init__(self, parent=None): canvas = Canvas(width=400, height=3

Re: Asynchronous programming

2016-08-12 Thread Paul Rubin
Steven D'Aprano writes: >> await asyncio.sleep(0.2) # pretend to do some real work > That is *awesome*. Thank you for the example! Keep in mind that the above basically takes the task off the list of runnables for 0.2 seconds, so it sits doing nothing and doesn't interfere with other tas

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread Steven D'Aprano
On Sat, 13 Aug 2016 08:12 am, Lawrence D’Oliveiro wrote: > On Friday, August 12, 2016 at 9:39:11 PM UTC+12, BartC wrote: > >> 'year' has been spelled wrongly > > That’s why Python has __slots__. No, that is OFFICIALLY *not* why Python has __slots__. Python has __slots__ in order to support app

Re: A strange list concatenation result

2016-08-12 Thread Steven D'Aprano
On Sat, 13 Aug 2016 06:44 am, Mok-Kong Shen wrote: > list2 = [1,2,3] > list1 += [4,5,6] > print(list1, list2) >> [1, 2, 3, 4, 5, 6] [1, 2, 3] >> >> >> Does that help? > > I don't yet understand why in my 2nd example list2 came out as > [1, 2, 3] outside. Because you assign list2 = [1

Re: Asynchronous programming

2016-08-12 Thread Steven D'Aprano
On Fri, 12 Aug 2016 03:47 pm, Paul Rudin wrote: > Steven D'Aprano writes: > >> Thanks to everyone who has answered, I think I'm slowly starting to get >> it now. Let's see if we can come up with a toy example that doesn't >> involve low-level socket programming :-) >> >> Let me simulate a slow f

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread Juan Pablo Romero Méndez
2016-08-12 1:10 GMT-07:00 Lawrence D’Oliveiro : > On Thursday, August 11, 2016 at 8:33:41 AM UTC+12, Juan Pablo Romero > Méndez wrote: > > > I've been trying to find (without success so far) an example of a > situation > > where the dynamic features of a language like Python provides a clear > > a

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread BartC
On 12/08/2016 23:12, Lawrence D’Oliveiro wrote: On Friday, August 12, 2016 at 9:39:11 PM UTC+12, BartC wrote: 'year' has been spelled wrongly That’s why Python has __slots__. OK. So when I said: > > My example was specifically about attribute names where pre-declaring > the set of allowed

Error running an exe file in Windows with reportlab import

2016-08-12 Thread Ernest Bonat, Ph.D.
I have created a simple Python program including the following packages: import numpy as np import matplotlib.pyplot as plt import pandas as pd from reportlab.pdfgen import canvas if __name__ == '__main__': print("Hi!") I have created the installation package (PyInstaller) using th

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread Lawrence D’Oliveiro
On Friday, August 12, 2016 at 9:39:11 PM UTC+12, BartC wrote: > 'year' has been spelled wrongly That’s why Python has __slots__. -- https://mail.python.org/mailman/listinfo/python-list

Meta Python Chapter 3 Available

2016-08-12 Thread Charles Ross
I’ve completed a first draft of Chapter 3: Modules (and Packages) of the Meta Python book. Feedback from novices and experts alike would be welcome. https://github.com/chivalry/meta-python Thanks, Chuck -- https://mail.python.org/mailman/listinfo/pytho

Re: A strange list concatenation result

2016-08-12 Thread Mok-Kong Shen
Am 11.08.2016 um 23:49 schrieb Gary Herron: On 08/11/2016 03:06 PM, Mok-Kong Shen wrote: def test(list1,list2): list1+=[4,5,6] list2=list2+[4,5,6] print("inside ",list1,list2) return [snip] # With list1=[1,2,3] list2=[1,2,3] test(list1,list2) print("outside",list1,list2) # I got th

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread William Ray Wing
> On Aug 12, 2016, at 7:07 AM, Steven D'Aprano > wrote: > > [megabyte] > > > [1] Are there programming language aware spell checkers? If not, there > should be. > > There are programming language-aware editors with built-in spell checkers (and syntax coloring, but that’s a diff

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread Michael Selik
On Fri, Aug 12, 2016, 7:11 AM Steven D'Aprano wrote: > > [1] Are there programming language aware spell checkers? If not, there > should be. > A good autocomplete is much like a spell-checker. I have far fewer spelling errors when using an editor with autocomplete. > -- https://mail.python.org

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread Michael Torrie
On 08/12/2016 05:07 AM, Steven D'Aprano wrote: > The first time I ever compiled a full-sized application (not a particular > large one either, it was a text editor a little more featureful than > Notepad) it took something like nine hours to compile on a Mac SE (this was > circa 1990). How mad woul

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread BartC
On 12/08/2016 12:55, BartC wrote: On 12/08/2016 12:07, Steven D'Aprano wrote: The first time I ever compiled a full-sized application (not a particular large one either, it was a text editor a little more featureful than Notepad) it took something like nine hours to compile on a Mac SE (this w

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread BartC
On 12/08/2016 12:07, Steven D'Aprano wrote: On Fri, 12 Aug 2016 07:38 pm, BartC wrote: 'year' has been spelled wrongly How do you know? I know because my intention was to create a RECORD, with a specific set of members or fields. With records, you usually don't just create arbitrary named

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread Steven D'Aprano
On Fri, 12 Aug 2016 07:58 pm, BartC wrote: > On 12/08/2016 10:45, Chris Angelico wrote: >> On Fri, Aug 12, 2016 at 7:38 PM, BartC wrote: >>> You can be too dynamic. Take an example like this: > >>> d.yaer=1999 [...] > How would a linter know that you didn't /want/ to create a new attribute > ca

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread Steven D'Aprano
On Fri, 12 Aug 2016 07:38 pm, BartC wrote: > 'year' has been spelled wrongly How do you know? The point is that it is intentional that callers can set arbitrary attributes on (most) objects. It is perfectly legitimate to set: d.year d.century d.owner d.extra_seconds and, yes, even d.yaer, sinc

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread BartC
On 12/08/2016 10:45, Chris Angelico wrote: On Fri, Aug 12, 2016 at 7:38 PM, BartC wrote: You can be too dynamic. Take an example like this: d.yaer=1999 print (d.day,d.month,d.year) This would never get past a static language nor some that also have dynamic types. Nor will it get past

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread Chris Angelico
On Fri, Aug 12, 2016 at 7:38 PM, BartC wrote: > You can be too dynamic. Take an example like this: > > class date: > def __init__(self,d,m,y): > self.day=d > self.month=m > self.year=y > > d=date(25,12,2015) > > d.yaer=1999 > > print (d.day,d.month,d.year) > > '

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread BartC
On 12/08/2016 09:38, Marko Rauhamaa wrote: Lawrence D’Oliveiro : With static languages, once a piece of code compiles without errors, you have a slightly higher level of confidence in its correctness than with a dynamic language. On the other hand, a dynamic language allows me to be much more

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread Marko Rauhamaa
Lawrence D’Oliveiro : > With static languages, once a piece of code compiles without errors, > you have a slightly higher level of confidence in its correctness than > with a dynamic language. > > On the other hand, a dynamic language allows me to be much more > productive, because I have to write

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread Lawrence D’Oliveiro
On Thursday, August 11, 2016 at 8:33:41 AM UTC+12, Juan Pablo Romero Méndez wrote: > I've been trying to find (without success so far) an example of a situation > where the dynamic features of a language like Python provides a clear > advantage over languages with more than one type. I have used