Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-13 Thread Alf P. Steinbach
* Steven D'Aprano: On Wed, 13 Jan 2010 06:55:27 +0100, Alf P. Steinbach wrote: * Steven D'Aprano: On Tue, 12 Jan 2010 23:47:31 +0100, Alf P. Steinbach wrote: PS: Next time it would have helped to include a URL to the issue. http://bugs.python.org/issue7681 FYI there

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-13 Thread Alf P. Steinbach
* Steven D'Aprano: Nobody is trying to understate the complexity of writing a large application that supports both 2.6 and 3.x, or of taking an existing library written for 2.5 and upgrading it to support 3.1. But the magnitude of these tasks is no greater (and potentially smaller) than supp

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-13 Thread Alf P. Steinbach
* Stefan Behnel: Alf P. Steinbach, 13.01.2010 06:55: * Steven D'Aprano: I think you need to chill out and stop treating a simple bug report as a personal slight on you. I'm sorry but you're again trying to make people believe something that you know is false, which is common

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Alf P. Steinbach
* Stefan Behnel: Alf P. Steinbach, 13.01.2010 06:39: * Steven D'Aprano: On Tue, 12 Jan 2010 23:42:28 +0100, Alf P. Steinbach wrote: It is hopeless, especially for a newbie, to create correct Python 2.x+3.x compatible code, except totally trivial stuff of course. So you allege, but

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Alf P. Steinbach
* Terry Reedy: On 1/12/2010 6:31 PM, Alf P. Steinbach wrote: Perhaps change to CAPTCHA instead of mail confirmation. I disagree. The point of mail confirmation is not just to assure that a human is registering, but that we have a valid email for responses to be sent to. Many issues are

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Alf P. Steinbach
* Steven D'Aprano: On Tue, 12 Jan 2010 23:47:31 +0100, Alf P. Steinbach wrote: PS: Next time it would have helped to include a URL to the issue. http://bugs.python.org/issue7681 FYI there is already some feedback in the tracker. Yeah, someone who had the bright idea that maybe

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Alf P. Steinbach
* Steven D'Aprano: On Tue, 12 Jan 2010 23:42:28 +0100, Alf P. Steinbach wrote: * André: On Jan 12, 9:33 am, "Alf P. Steinbach" wrote: Well, this is for my Python (actually, beginning programmer) writings, at http://tinyurl.com/programmingbookP3 Thanks for writing thi

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Steve Holden: [...] FYI there is already some feedback in the tracker. Yeah, someone who had the bright idea that maybe there isn't a bug, thinking instead that maybe a "wrong" name in *a comment* might be the culprit -- of all

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: If you have any suggestions for improving things (and the same goes for any other readers) I will be happy to listen to them. I do agree that the bug tracker is a rather high hurdle for people to have to jump over just to offer feedback on software faults

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Stefan Behnel: Alf P. Steinbach, 12.01.2010 12:51: Well how f*g darn patient do they expect me to be? I've decided: I'm not. Oh sh**, just as I typed the period above the mail finally arrived. It's been, let's see, about 20+

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Alf P. Steinbach
* André: On Jan 12, 9:33 am, "Alf P. Steinbach" wrote: Well, this is for my Python (actually, beginning programmer) writings, at http://tinyurl.com/programmingbookP3 Thanks for writing this book. I just had a quick look at the beginning of it where you write: === As of th

Re: Fractional Hours from datetime?

2010-01-12 Thread Martin P. Hellwig
W. eWatson wrote: >>> now = datetime.datetime.now() >>> fractional_hour = now.hour + now.minute / 60.0 See my post about the datetime controversy about 3-4 posts up from yours. If timezones might be a problem area, than it might be worth while to see it in the context of the actual applic

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Alf P. Steinbach
* Stefan Behnel: Alf P. Steinbach, 12.01.2010 13:10: * Stefan Behnel: Maybe you should just stop using the module. Writing the code yourself is certainly going to be faster than reporting that bug, don't you think? It's part of the standard Python distribution. Don't you th

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Alf P. Steinbach
* Stefan Behnel: Alf P. Steinbach, 12.01.2010 12:51: Well how f*g darn patient do they expect me to be? I've decided: I'm not. Oh sh**, just as I typed the period above the mail finally arrived. It's been, let's see, about 20+ minutes! And still some miles to go.

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Alf P. Steinbach
* Alf P. Steinbach: * Steve Holden: Alf P. Steinbach wrote: [...] PS: It would be nice if someone(TM) could describe here in detail how to properly report errors like this. Of course I'm not going to do it if it involves establishing Yet Another Account somewhere. But hopefully it do

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: [...] PS: It would be nice if someone(TM) could describe here in detail how to properly report errors like this. Of course I'm not going to do it if it involves establishing Yet Another Account somewhere. But hopefully it doesn't? That's

Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Alf P. Steinbach
Argh! This was really annoying! Much time wasted (one naturally thinks that silly error must be one's own). But, anyway: Lines: 244 nitems = (chunk.chunksize - chunk.size_read) / self._sampwidth 464 self._nframes = initlength / (self._nchannels * self._sampwidth) Need to use Python 3.x

Re: Fractional Hours from datetime?

2010-01-11 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * W. eWatson: Ben Finney wrote: "W. eWatson" writes: See my post about the datetime controversy about 3-4 posts up from yours. This forum is distributed, and there's no “up” or “3-4 messages” that is common for all readers. Cou

Re: Fractional Hours from datetime?

2010-01-11 Thread Alf P. Steinbach
* W. eWatson: Ben Finney wrote: "W. eWatson" writes: See my post about the datetime controversy about 3-4 posts up from yours. This forum is distributed, and there's no “up” or “3-4 messages” that is common for all readers. Could you give the Message-ID for that message? Sort of like oute

Re: PIL how to display multiple images side by side

2010-01-11 Thread Alf P. Steinbach
* suresh.amritapuri: On Jan 9, 9:51 pm, "Alf P. Steinbach" wrote: * Lie Ryan: On 1/9/2010 8:43 AM, suresh.amritapuri wrote: Hi, In PIL, how to display multiple images in say m rows and n colums when I have m*n images. suresh Tkinter has PhotoImage widget and PIL has support for t

Re: Fractional Hours from datetime?

2010-01-11 Thread Martin P. Hellwig
Martin P. Hellwig wrote: W. eWatson wrote: Maybe there's a more elegant way to do this. I want to express the result of datetime.datetime.now() in fractional hours. Here's one way. dt=datetime.datetime.now() xtup = dt.timetuple() h = xtup[3]+xtup[4]/60.0+xtup[5]/3600.00+xtup[6]/10

Re: Fractional Hours from datetime?

2010-01-11 Thread Martin P. Hellwig
W. eWatson wrote: Maybe there's a more elegant way to do this. I want to express the result of datetime.datetime.now() in fractional hours. Here's one way. dt=datetime.datetime.now() xtup = dt.timetuple() h = xtup[3]+xtup[4]/60.0+xtup[5]/3600.00+xtup[6]/10**6 # now is in fractions of an hour

Re: how to duplicate array entries

2010-01-11 Thread Alf P. Steinbach
* Chris Rebert: On Mon, Jan 11, 2010 at 2:20 AM, Alf P. Steinbach wrote: * Chris Rebert: On Mon, Jan 11, 2010 at 1:03 AM, Alf P. Steinbach wrote: * Steven D'Aprano: On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote: * Paul Rudin: Sebastian writes: Using the term &

Re: how to duplicate array entries

2010-01-11 Thread Alf P. Steinbach
* Chris Rebert: On Mon, Jan 11, 2010 at 1:03 AM, Alf P. Steinbach wrote: * Steven D'Aprano: On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote: * Paul Rudin: Sebastian writes: I have an array x=[1,2,3] In python such an object is called a "list". (In cpython i

Re: how to duplicate array entries

2010-01-11 Thread Alf P. Steinbach
* Steven D'Aprano: On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote: * Paul Rudin: Sebastian writes: I have an array x=[1,2,3] In python such an object is called a "list". (In cpython it's implemented as an automatically resizable array.) I don't t

Re: how to duplicate array entries

2010-01-11 Thread Alf P. Steinbach
* Paul Rudin: Sebastian writes: I have an array x=[1,2,3] In python such an object is called a "list". (In cpython it's implemented as an automatically resizable array.) I don't think the OP's terminology needs correction. A Python "list" is an array functionality-wise. If one isn't ob

Re: PIL how to display multiple images side by side

2010-01-09 Thread Alf P. Steinbach
* Lie Ryan: On 1/9/2010 8:43 AM, suresh.amritapuri wrote: Hi, In PIL, how to display multiple images in say m rows and n colums when I have m*n images. suresh Tkinter has PhotoImage widget and PIL has support for this widget: http://www.pythonware.com/library/pil/handbook/imagetk.htm Maybe

Re: How do you configure IDLE on a Mac, seeing as there's no Configure Option...

2010-01-04 Thread Alf P. Steinbach
* Mensanator: ...because there's no [Options] menu on the shell window? Or at least give me a clue to how to use Courier New font? For some inscrutable reason, depite the plethora of formatting tools, someone decided that proportional spaced fonts ought to be the default for IDLE. Why not jus

Re: Instantiate an object based on a variable name

2009-12-31 Thread Martin P. Hellwig
Wells wrote: Sorry, this is totally basic, but my Google-fu is failing: I have a variable foo. I want to instantiate a class based on its value- how can I do this? My crystal ball is failing too, could you please elaborate on what exactly you want to do, some pseudo code with the intended res

Re: getting name of passed reference

2009-12-29 Thread Martin P. Hellwig
Joel Davis wrote: I'm just curious if anyone knows of a way to get the variable name of a reference passed to the function. Put another way, in the example: def MyFunc ( varPassed ): print varPassed; MyFunc(nwVar) how would I get the string "nwVar" from inside of "MyFunc"? is it poss

Re: Python (and me) getting confused finding keys

2009-12-22 Thread Alf P. Steinbach
* Steven D'Aprano: [snip] The obvious follow-up is to ask how to make an immutable class. http://northernplanets.blogspot.com/2007/01/immutable-instances-in-python.html Thanks, I've been wondering about that. By the way, the link at the bottom in the article you linked to, referring to an

Re: Ch 3 of my writings, first few sections posted

2009-12-21 Thread Alf P. Steinbach
doubt that there are many errors etc., all mine!). * Alf P. Steinbach, in [comp.lang.python]: Tentatively titled "Foundations". Also, these first 2/3 sections may be moved to some later point, i.e. even the structure is tentative, but I'd value comments! http://tinyurl.c

Re: How to validate the __init__ parameters

2009-12-21 Thread Alf P. Steinbach
* Denis Doria: I thought in something like: class A: def __init__(self, foo = None, bar = None): set_foo(foo) self._bar = bar def set_foo(self, foo): if len(foo) > 5: raise _foo = foo foo = property(setter = set_foo) But looks too much

Ch 3 of my writings, first few sections posted

2009-12-21 Thread Alf P. Steinbach
Tentatively titled "Foundations". Also, these first 2/3 sections may be moved to some later point, i.e. even the structure is tentative, but I'd value comments! http://tinyurl.com/programmingbookP3> Table of contents: 3 Foundations 1 3.1 Some necessary math notation & terminology. 2 3.1.

Re: Windows, IDLE, __doc_, other

2009-12-21 Thread Alf P. Steinbach
* Alf P. Steinbach: * W. eWatson: When I use numpy.__doc__ in IDLE under Win XP, I get a heap of words without reasonable line breaks. "\nNumPy\n=\n\nProvides\n 1. An array object of arbitrary homogeneous items\n 2. Fast mathematical operations over arrays\n 3. Linear Al

Re: Windows, IDLE, __doc_, other

2009-12-20 Thread Alf P. Steinbach
* W. eWatson: When I use numpy.__doc__ in IDLE under Win XP, I get a heap of words without reasonable line breaks. "\nNumPy\n=\n\nProvides\n 1. An array object of arbitrary homogeneous items\n 2. Fast mathematical operations over arrays\n 3. Linear Algebra, Fourier Transforms, Random N

Re: Programming intro book ch1 and ch2 (Windows/Python 3) - Request For Comments

2009-12-20 Thread Alf P. Steinbach
;m writing is /meant/ to be sufficient for unassisted self study; and of course I think my progression is better, e.g. introducing loops and decisions very early. However, all those exercises... I wish Someone(TM) could cook up Really Interesting exercises for my manuscript! :-P -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming intro book ch1 and ch2 (Windows/Python 3) - Request For Comments

2009-12-19 Thread Alf P. Steinbach
* John Posner: On Fri, 18 Dec 2009 13:00:48 -0500, Alf P. Steinbach wrote: Chapter 2 is about Basic Concepts (of programming). It's the usual: variables, ... 1. Overall suggestion You have a tendency to include non-pertinent asides [1]. But then, rambling a bit endows a manuscript

Re: Programming intro book ch1 and ch2 (Windows/Python 3) - Request For Comments

2009-12-18 Thread Alf P. Steinbach
* Steven D'Aprano: On Sat, 19 Dec 2009 04:29:22 +0100, Alf P. Steinbach wrote: * Steven D'Aprano: On Sat, 19 Dec 2009 01:25:48 +0100, Alf P. Steinbach wrote: That said, and a bit off-tangent to your comment's main thrust, the time spent on coding that repeated-division-by

Re: Programming intro book ch1 and ch2 (Windows/Python 3) - Request For Comments

2009-12-18 Thread Alf P. Steinbach
* Steven D'Aprano: On Sat, 19 Dec 2009 04:04:51 +0100, Alf P. Steinbach wrote: * Steven D'Aprano: On Fri, 18 Dec 2009 19:00:48 +0100, Alf P. Steinbach wrote: In fact almost no Python code does, but then it seems that people are not aware of how many of their names are constants

Re: Programming intro book ch1 and ch2 (Windows/Python 3) - Request For Comments

2009-12-18 Thread Alf P. Steinbach
* Mensanator: That said, and a bit off-tangent to your comment's main thrust, the time spent on coding that repeated-division-by-2 optimization would, I think, be better spent googling "Collatz Conjecture" -- avoiding writing /any/ code. ;-) Ha! I know more about Collatz than you can ever fi

Re: Creating Classes

2009-12-18 Thread Alf P. Steinbach
* Dave Angel -> seafoid: One other point: you should always derive a class from some other class, or 'object' by default. So you should being the class definition by: class Seq(object): Why? It mainly has to do with super(). But in any case if you omit the 'object' it's an "old style"

Re: Programming intro book ch1 and ch2 (Windows/Python 3) - Request For Comments

2009-12-18 Thread Alf P. Steinbach
* Steven D'Aprano: On Sat, 19 Dec 2009 01:25:48 +0100, Alf P. Steinbach wrote: That said, and a bit off-tangent to your comment's main thrust, the time spent on coding that repeated-division-by-2 optimization would, I think, be better spent googling "Collatz Conjecture"

Re: Programming intro book ch1 and ch2 (Windows/Python 3) - Request For Comments

2009-12-18 Thread Alf P. Steinbach
* Steven D'Aprano: On Fri, 18 Dec 2009 19:00:48 +0100, Alf P. Steinbach wrote: In fact almost no Python code does, but then it seems that people are not aware of how many of their names are constants and think that they're uppercasing constants when in fact they're not. E.g. ro

Re: Programming intro book ch1 and ch2 (Windows/Python 3) - Request For Comments

2009-12-18 Thread Alf P. Steinbach
* Mensanator: The second deviation is that since most names are constants, Really? Does that mean you don't use literals, to save the time required to convert them to integers? Isn't that done at compile time? So, instead of doing the Collatz Conjecture as while a>1: f = gmpy.scan1(a,0) i

Re: iterators and views of lists

2009-12-18 Thread Alf P. Steinbach
* Carl Banks: On Dec 18, 11:08 am, "Alf P. Steinbach" wrote: * Carl Banks: On Dec 17, 10:00 pm, Brendan Miller wrote: On Thu, Dec 17, 2009 at 6:44 PM, Steven D'Aprano wrote: On Thu, 17 Dec 2009 12:07:59 -0800, Brendan Miller wrote: I was thinking it would be cool to m

Re: iterators and views of lists

2009-12-18 Thread Alf P. Steinbach
* Carl Banks: On Dec 17, 10:00 pm, Brendan Miller wrote: On Thu, Dec 17, 2009 at 6:44 PM, Steven D'Aprano wrote: On Thu, 17 Dec 2009 12:07:59 -0800, Brendan Miller wrote: I was thinking it would be cool to make python more usable in programming competitions by giving it its own port of the

Programming intro book ch1 and ch2 (Windows/Python 3) - Request For Comments

2009-12-18 Thread Alf P. Steinbach
I finally finished (draft), I believe!, chapter 2... Chapter 1 gets the reader up & running, i.e. it's "Hello, world!", basic tool usage, without discussing anything about programming really. One reaction to this chapter, based on the two example programs in it, was that it wasn't gradual and

Re: shouldn't list comprehension be faster than for loops?

2009-12-17 Thread Alf P. Steinbach
* Carlos Grohmann: Hello all I am testing my code with list comprehensions against for loops. the loop: dipList=[float(val[1]) for val in datalist] dip1=[] for dp in dipList: if dp == 90: dip1.append(dp - 0.01) else: dip1.append(dp) listcomp

Re: How to create a self-destructing Tkinter dialog box?

2009-12-16 Thread Martin P. Hellwig
mrstevegross wrote: Ok, I would like to put together a Python/Tkinter dialog box that displays a simple message and self-destructs after N seconds. Is there a simple way to do this? Thanks, --Steve Just, thinking aloud, I probably would do something like registering the [place|grid|pack]_for

Re: Either IDLE Can't Start a subprocess or a firewall software firewall is blocking the connection (Win)--Battlin McAfee

2009-12-16 Thread Alf P. Steinbach
* W. eWatson: See Subject msg from Python 2.5 Win XP. It is preceded by a "Socket Error". It happened while I had a simple program displayed, and I wanted to see the shell. The msg occurred when I pressed Shell on Run from the menu. I played around for awhile, but got nowhere. Same msg. I did

Re: More stuff added to ch 2 of my programming intro

2009-12-16 Thread Alf P. Steinbach
* Mensanator: On Dec 16, 5:45 pm, "Alf P. Steinbach" wrote: * Mensanator: On Dec 16, 4:41 pm, Mensanator wrote: On Dec 14, 1:23 am, "Alf P. Steinbach" wrote: * Alf P. Steinbach: Format: PDF http://preview.tinyurl.com/ProgrammingBookP3> The new stuff

Re: More stuff added to ch 2 of my programming intro

2009-12-16 Thread Alf P. Steinbach
* Mensanator: On Dec 16, 4:41 pm, Mensanator wrote: On Dec 14, 1:23 am, "Alf P. Steinbach" wrote: * Alf P. Steinbach: Format: PDF http://preview.tinyurl.com/ProgrammingBookP3> The new stuff, section 2.7, is about programs as simulations and handling data, focusin

Re: More stuff added to ch 2 of my programming intro

2009-12-16 Thread Alf P. Steinbach
* Alf P. Steinbach: * Alf P. Steinbach: Format: PDF http://preview.tinyurl.com/ProgrammingBookP3> The new stuff, section 2.7, is about programs as simulations and handling data, focusing on modeling things. It includes some Python GUI programming. The plan is to discuss containers l

Re: More stuff added to ch 2 of my programming intro

2009-12-13 Thread Alf P. Steinbach
* Alf P. Steinbach: Format: PDF http://preview.tinyurl.com/ProgrammingBookP3> The new stuff, section 2.7, is about programs as simulations and handling data, focusing on modeling things. It includes some Python GUI programming. The plan is to discuss containers like lists

Re: insert unique data in a list

2009-12-13 Thread Alf P. Steinbach
* mattia: How can I insert non-duplicate data in a list? I mean, is there a particular option in the creation of a list that permit me not to use something like: def append_unique(l, val): if val not in l: l.append(val) How about using a set instead? >>> a = {1, 2, 3} >>> a

Re: Manipulating MySQL Sets

2009-12-13 Thread Robert P. J. Day
On Sun, 13 Dec 2009, Victor Subervi wrote: > On Sun, Dec 13, 2009 at 11:56 AM, Robert P. J. Day > wrote: > On Sun, 13 Dec 2009, Victor Subervi wrote: > > > On Sun, Dec 13, 2009 at 11:36 AM, Carsten Haese > > > wrote: > >      

Re: Manipulating MySQL Sets

2009-12-13 Thread Robert P. J. Day
to expect, how could you > possibly write code that produces what you expect? (Don't answer > this question. It's a rhetorical question.) http://twitter.com/rpjday/status/6576145809 rday -- ==== Robert P. J.

Re: Python for Newbies

2009-12-09 Thread Alf P. Steinbach
* rm: On Dec 9, 9:46 pm, "Alf P. Steinbach" wrote: * rm: Here is a new tutorial that may be a good starting point for learning Python. http://www.themaemo.com/python-for-newbies/ Looks nice. I have two comments: (1) what is "the N900"?, and (2) the naming conventio

Re: Python for Newbies

2009-12-09 Thread Alf P. Steinbach
* rm: Here is a new tutorial that may be a good starting point for learning Python. http://www.themaemo.com/python-for-newbies/ Looks nice. I have two comments: (1) what is "the N900"?, and (2) the naming convention, using 'Num' for a variable and 'clsAddress' for a class, is opposite of the

Re: tkinter photoimage, couldn't recognize image data (PPM)

2009-12-09 Thread Martin P. Hellwig
Terry Reedy wrote: DATA="""P3 3 2 255 255 0 0 0 255 0 0 0 255 255 255 0 255 255 255 0 0 0""" Should the string really have the newlines? Or should this be DATA="""P3\ 3 2\ 255\ 255 0 0 0 255 0 0 0 255\ 255 255 0 255 255 255 0 0 0""" I'

More stuff added to ch 2 of my programming intro

2009-12-09 Thread Alf P. Steinbach
Format: PDF http://preview.tinyurl.com/ProgrammingBookP3> The new stuff, section 2.7, is about programs as simulations and handling data, focusing on modeling things. It includes some Python GUI programming. The plan is to discuss containers like lists and dictionaries in perhaps two more

tkinter photoimage, couldn't recognize image data (PPM)

2009-12-09 Thread Martin P. Hellwig
Hi all, I've tried to display an image with the source being a string but it fails (see below). Is there a way to display PPM without writing it first to a file? Thanks, Martin - snippet - ''' Ubuntu 9.04 64bit, python 3.1 ''' import tkinter DATA="""P3 3 2 255 255 0 0 0 255

Re: SUB-MATRIX extraction

2009-12-08 Thread Martin P. Hellwig
Jon Clements wrote: On Dec 8, 1:36 pm, Pierre wrote: Hello, let b = array([ [0,1,2] , [3,4,5] , [6,7,8] ]) How can I easily extract the submatrix [ [0 ,1], [3, 4]] ? One possiblity is : b[[0,1],:][:,[0,1]] but it is not really easy ! Thanks. x = numpy.array([ [0,1,2], [3,4,5], [6,7,8] ])

Re: Duplicates of third-party libraries

2009-12-08 Thread Martin P. Hellwig
Grant Edwards wrote: Does windows even _have_ a library dependancy system that lets an application specify which versions of which libraries it requires? Well you could argue that easy_install does it a bit during install. Then there is 'Windows Side By Side' (winsxs) system which sorta does i

Re: Duplicates of third-party libraries

2009-12-08 Thread Martin P. Hellwig
Lie Ryan wrote: The only thing that package managers couldn't provide is for the extremist bleeding edge; those that want the latest and the greatest in the first few seconds the developers releases them. The majority of users don't fall into that category, most users are willing to wait a

Re: Duplicates of third-party libraries

2009-12-08 Thread Martin P. Hellwig
Lie Ryan wrote: Yes from an argumentative perspective you are right. But given the choice of being right and alienate the fast majority of my potential user base, I rather be wrong. For me the 'Although practicality beats purity' is more important than trying to beat a dead horse that is a p

Re: Duplicates of third-party libraries

2009-12-07 Thread Martin P. Hellwig
Ben Finney wrote: This omits the heart of the problem: There is an extra delay between release and propagation of the security fix. When the third-party code is released with a security fix, and is available in the operating system, the duplicate in your application will not gain the advantage o

Re: Duplicates of third-party libraries

2009-12-07 Thread Martin P. Hellwig
Ben Finney wrote: "Martin P. Hellwig" writes: Along with the duplication this introduces, it also means that any bug fixes — even severe security fixes — in the third-party code will not be addressed in your duplicate. I disagree, what you need is: - An automated build syste

Re: What is the significance of after() in this code?

2009-12-07 Thread Martin P. Hellwig
W. eWatson wrote: See Subject. def StackImages(self): self.Upload("P") self.after_id = self.master.after(1,self.GetFrameOne) If you are talking tkinter here, it is an alarm callback. See http://effbot.org/tkinterbook/widget.htm -- MPH http://blog.dcukt

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-06 Thread Alf P. Steinbach
* MRAB: Alf P. Steinbach wrote: > * Dennis Lee Bieber: >> On Sat, 05 Dec 2009 11:26:34 +0100, "Alf P. Steinbach" >> declaimed the following in >> gmane.comp.python.general: >> >>> The devolution of terminology has been so severe that now e

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-06 Thread Alf P. Steinbach
* Dennis Lee Bieber: On Sat, 05 Dec 2009 11:26:34 +0100, "Alf P. Steinbach" declaimed the following in gmane.comp.python.general: The devolution of terminology has been so severe that now even the Wikipedia article on this subject confounds the general concept of "routine"

Re: When will Python 3 be fully deployed

2009-12-06 Thread Martin P. Hellwig
Edward A. Falk wrote: For development purposes, you should stick with the oldest version that will actually run your code. Every time you move to a more modern version, you're leaving potential users/customers out in the cold. If the fear of customers disatification prevents you from using a

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-05 Thread Alf P. Steinbach
* Steven D'Aprano: On Sat, 05 Dec 2009 11:26:34 +0100, Alf P. Steinbach wrote: Regarding my terminology, "routine" instead "function" that everybody except you remarked on, it is of course intentional. [...] I think you failed to realise that your use of the term

Re: Can't print Chinese to HTTP

2009-12-05 Thread Alf P. Steinbach
* Lie Ryan: On 12/5/2009 2:57 PM, Gnarlodious wrote: On Dec 1, 3:06 pm, Terry Reedy wrote: def print(s): return sys.stdout.buffer.write(s.encode('utf-8')) Here is a better solution that lets me send any string to the function: def print(html): return sys.stdout.buffer.write(("Content-type:te

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-05 Thread Alf P. Steinbach
* Raymond Hettinger: On Dec 4, 2:03 am, "Alf P. Steinbach" wrote: Is this guaranteed to work in Python 3.x? >>> def foo(): pass ... >>> foo.blah = 222 >>> foo.blah 222 Yes, function attributes are guaranteed to be writable: http://www.python.o

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-04 Thread Alf P. Steinbach
* Marco Mariani: Alf P. Steinbach wrote: Is this guaranteed to work in Python 3.x? >>> def foo(): pass >>> foo.blah = 222 >>> foo.blah 222 >>> _ I don't see why it shouldn't work. For example, (42).blah = 666 The question is w

Are routine objects guaranteed mutable & with dictionary?

2009-12-04 Thread Alf P. Steinbach
Is this guaranteed to work in Python 3.x? >>> def foo(): pass ... >>> foo.blah = 222 >>> foo.blah 222 >>> _ Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Formatting logically nested actions -- Pythonic way?

2009-12-03 Thread Alf P. Steinbach
Hi. I discovered with tkinter the registration of widgets with layout managers (tkinter "geometry" managers, e.g. calls to pack()) needs to be done very hierarchically. And this leads to hierarchical code, which would be nice to indicate by indenting, but oops, indenting in Python is syntact

Re: Moving from Python 2 to Python 3: A 4 page "cheat sheet"

2009-12-02 Thread Martin P. Hellwig
Mark Summerfield wrote: It is available as a free PDF download (no registration or anything) from InformIT's website. Here's the direct link: http://ptgmedia.pearsoncmg.com/imprint_downloads/informit/promotions/python/python2python3.pdf Very handy! Am I wrong in assuming that you forgot to inc

Re: [Edu-sig] teaching python using turtle module

2009-11-30 Thread Alf P. Steinbach
* Edward Cherlin: On Sun, Nov 29, 2009 at 11:34, Brian Blais wrote: After a bit of playing, I realized that I couldn't think of many exaples which use turtle with conditional structures (if- and while- statements), Repeat is used much more often. but of course we can provide examples of any

Re: Req. for comments section "Basic Data" in intro book

2009-11-30 Thread Alf P. Steinbach
* Alf P. Steinbach: I added a section on "basic data" to ch 2 of my writings, an introduction to programming (with Python as main language). The intended reader is someone who is intelligent and wants to learn programming but knows little or nothing about it. As before it would be

Re: Creating a local variable scope.

2009-11-30 Thread Alf P. Steinbach
* Jean-Michel Pichavant: Steven D'Aprano wrote: On Mon, 30 Nov 2009 02:11:12 +0100, Alf P. Steinbach wrote: I think if one could somehow declare names as const (final, readonly, whatever) then that would cover the above plus much more. Having real constants is one feature that I

Re: semantics of ** (unexpected/inconsistent?)

2009-11-29 Thread Alf P. Steinbach
* Esmail: Ok, this is somewhat unexpected: Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> -3**2 -9 >>> x = -3 >>> x**2 9 >>> I would have expected the same result in both cases. Init

Re: Creating a local variable scope.

2009-11-29 Thread Alf P. Steinbach
* markolopa: On 18 Sep, 10:36, "markol...@gmail.com" wrote: On Sep 11, 7:36 pm, Johan Grönqvist wrote: I find several places in my code where I would like tohavea variable scope that is smaller than the enclosing function/class/module definition. This is one of the single major frustrations

Req. for comments section "Basic Data" in intro book

2009-11-28 Thread Alf P. Steinbach
I added a section on "basic data" to ch 2 of my writings, an introduction to programming (with Python as main language). The intended reader is someone who is intelligent and wants to learn programming but knows little or nothing about it. As before it would be nice with feedback on this.

Re: UnicodeDecodeError? Argh! Nothing works! I'm tired and hurting and...

2009-11-23 Thread Alf P. Steinbach
* Alf P. Steinbach: import os import fileinput def write( s ): print( s, end = "" ) msg_id = 0 f = open( "nul", "w" ) for line in fileinput.input( mode = "rb" ): if line.startswith( "From - " ): msg_id += 1; f.close()

UnicodeDecodeError? Argh! Nothing works! I'm tired and hurting and...

2009-11-23 Thread Alf P. Steinbach
This is the tragic story of this evening: 1. Aspirins to lessen the pain somewhat. 2. Over in [comp.programming] someone mentions paper on Quicksort. 3. I recall that X once sent me link to paper about how to foil Quicksort, written by was it Doug McIlroy, anyway some Bell Labs guy. Want to

Re: Is an interactive command a block?

2009-11-20 Thread Alf P. Steinbach
* Benjamin Kaplan: On Thu, Nov 19, 2009 at 4:42 PM, Alf P. Steinbach wrote: * Steven D'Aprano: I feel that there's still something lacking in my understanding though, like how/where the "really actually just pure local not also global" is defined for function definition,

Re: Is an interactive command a block?

2009-11-20 Thread Alf P. Steinbach
* Steven D'Aprano: On Thu, 19 Nov 2009 21:37:17 +0100, Alf P. Steinbach wrote: The CPython 3.1.1 language reference §4.1 says "Each command typed interactively is a block." It also says "If a name is bound in a block, it is a local variable of that block, un

Is an interactive command a block?

2009-11-20 Thread Alf P. Steinbach
The CPython 3.1.1 language reference §4.1 says "Each command typed interactively is a block." It also says "If a name is bound in a block, it is a local variable of that block, unless declared as nonlocal" Even with a non-literal try-for-best-meaning reading I can't get this to mesh wi

Re: New syntax for blocks

2009-11-17 Thread Russ P.
On Nov 17, 7:28 am, Jonathan Saxton wrote: > On Thu, 12 Nov 2009 21:27:31 +0100, Bruno Desthuilliers wrote: > >> Congratulations, you just reinvented one of the most infamous source of > >> bugs in C, C++, Java, PHP, javascript and quite a few other languages. > >> Believe it or not, but not allow

Re: TODO and FIXME tags

2009-11-17 Thread Martin P. Hellwig
Ben Finney wrote: Chris Rebert writes: 2009/11/16 Yasser Almeida Hernández : How is the sintaxis for set the TODO and FIXME tags...? There is no special syntax for those. Some people use them in comments, but it's just a convention. This is true. However, the convention is fairly well esta

Re: Code for finding the 1000th prime

2009-11-15 Thread Robert P. J. Day
Science and Programming. Thanks, Ray it's 7919. rday -- ==== Robert P. J. Day Waterloo, Ontario, CANADA Linux Consulting, Training and Kernel Pe

Re: Psyco on 64-bit machines

2009-11-14 Thread Russ P.
On Nov 12, 12:06 pm, "Russ P." wrote: > I have a Python program that runs too slow for some inputs. I would > like to speed it up without rewriting any code. Psyco seemed like > exactly what I need, until I saw that it only works on a 32-bit > architecture. I work in an env

Re: Psyco on 64-bit machines

2009-11-14 Thread Russ P.
On Nov 14, 10:15 am, "Diez B. Roggisch" wrote: > Russ P. schrieb: > > > I have a Python program that runs too slow for some inputs. I would > > like to speed it up without rewriting any code. Psyco seemed like > > exactly what I need, until I saw that it only wor

Re: A "terminators' club" for clp

2009-11-14 Thread Alf P. Steinbach
* gil_johnson: On Nov 13, 5:29 pm, kj wrote: [...] Or it could be set up so that at least n > 1 "delete" votes and no "keep" votes are required to get something nixed. Etc. This seems simpler than all-out moderation. ("all-out moderation"? now, there's an oxymoron for ya!) How about using

Re: python simply not scaleable enough for google?

2009-11-14 Thread Alf P. Steinbach
* Vincent Manis: On 2009-11-14, at 01:11, Alf P. Steinbach wrote: OK, now we've reached a total breakdown in communication, Alf. You appear to take exception to distinguishing between a language and its implementation. Not at all. But that doesn't mean that making that distinction

Re: python simply not scaleable enough for google?

2009-11-14 Thread Alf P. Steinbach
* sturlamolden: On 12 Nov, 18:32, "Alf P. Steinbach" wrote: Hm, this seems religious. Of course Python is slow: if you want speed, pay for it by complexity. Not really. The speed problems of Python can to a large extent be attributed to a sub-optimal VM. Perl tends to be much f

Re: python simply not scaleable enough for google?

2009-11-14 Thread Alf P. Steinbach
* Vincent Manis: On 2009-11-14, at 00:22, Alf P. Steinbach wrote, in response to my earlier post. Anyways, it's a good example of focusing on irrelevant and meaningless precision plus at the same time utilizing imprecision, higgedly-piggedly as it suits one's argument. Mixing ha

<    3   4   5   6   7   8   9   10   11   12   >