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: 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: 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: 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-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-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
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: 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] ])

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

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

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'

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: 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: 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: 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: 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-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
* 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: 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: 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: 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

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: 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

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: 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: 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
* 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: 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
* 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: 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
* 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-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-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: 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: 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

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: 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

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: 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: 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: 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: 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: 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 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: 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
* 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
* 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: 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: 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: 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 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: 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

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: 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

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
* 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
* 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: 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
* 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: 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
* 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: * 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
* 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
* 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
* 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
* 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-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-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
* 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

Those two controversial 2nd & 3rd paragraphs of my ch 1

2010-01-13 Thread Alf P. Steinbach
Referring to http://tinyurl.com/programmingbookP3> Due to especially Steven D'Aprano's comments I've replaced "hopeless" with "very hard" in paragraph 1 of section 1.1 -- I know he'll disagree with that also but I think any more downplaying of the difficulties would be misleading. According

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-13 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * 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

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-13 Thread Alf P. Steinbach
* Alf P. Steinbach: * Steve Holden: Alf P. Steinbach wrote: * 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 magnitu

Re: Those two controversial 2nd & 3rd paragraphs of my ch 1

2010-01-13 Thread Alf P. Steinbach
* Daniel Fetchinson: Nobody is deliberately trying to keep people from porting! I think you misunderstand what is being said, these two statements are very different: (1) single code base working on both python versions (2) creating a second code from a code so that the second code works with py

A simple-to-use sound file writer

2010-01-13 Thread Alf P. Steinbach
Just as a contribution, since someone hinted that I haven't really contributed much to the Python community. The [simple_sound] code will probably go into my ch 3 at http://tinyurl.com/programmingbookP3>, but sans sine wave generation since I haven't yet discussed trig functions, and maybe /wit

Re: maintain 2 versions of python on my computer

2010-01-14 Thread Alf P. Steinbach
* luis: Hi I am not an expert in programming and using Python for its simplicity I have 2 versions of python installed on my computer (windos xp) to begin the transition from version 2.4 to 2.6 or 3. maintaining the operability of my old scripts Is there any way to indicate the version of the

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: Just as a contribution, since someone hinted that I haven't really contributed much to the Python community. The [simple_sound] code will probably go into my ch 3 at http://tinyurl.com/programmingbookP3>, but sans sine wave generation since I hav

Re: a problem with writing a generator

2010-01-14 Thread Alf P. Steinbach
* Paweł Banyś: Hello, Please forgive me if I repeat the subject anyhow. I am trying to write a simple program in Python which scans a config file in search for "include" lines. If those lines are found, the files included there are followed and scanned and if any further "include" lines are foun

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Steve Holden: Alf P. Steinbach wrote: Just as a contribution, since someone hinted that I haven't really contributed much to the Python community. The [simple_sound] code will probably go into my ch 3 at http://tinyurl.com/programmingbookP3&

Re: Those two controversial 2nd & 3rd paragraphs of my ch 1

2010-01-14 Thread Alf P. Steinbach
* Lie Ryan -> Alf P. Steinbach: why do you think it is "impossible" to write a complex and portable python script? I don't. You're not quoting me. Though keeping everything in one code base may often be difficult and only of little practical benefit, it is not imp

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Mel: Alf P. Steinbach wrote: * Steve Holden: It's not clear to me that you can approximate any waveform with a suitable combination of square waves, Oh. It's simple to prove. At least conceptually! :-) Consider first that you need an infinite number of sine waves to create

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Steve Holden: [...] With the goal of just a rough approximation you can go about it like this: 1. Divide a full cycle of the sine wave into n intervals. With sine wave frequency f this corresponds to n*f sample rate for digital

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Peter Otten: Alf P. Steinbach wrote: Just as a contribution, since someone hinted that I haven't really contributed much to the Python community. The [simple_sound] code will probably go into my ch 3 at http://tinyurl.com/programmingbookP3>, but sans sine wave generation since I hav

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Grant Edwards: On 2010-01-14, Alf P. Steinbach wrote: It's not clear to me that you can approximate any waveform with a suitable combination of square waves, Oh. It's simple to prove. At least conceptually! :-) [...] With the goal of just a rough approximation you can go abo

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Steve Holden: Grant Edwards wrote: On 2010-01-14, Alf P. Steinbach wrote: [bogus hand-waving] After all, it's the basis of digital representation of sound! Huh? I've only studied basic DSP, but I've never heard/seen that as the basis of digital represention of sound.

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Steve Holden: Grant Edwards wrote: On 2010-01-14, Alf P. Steinbach wrote: [bogus hand-waving] After all, it's the basis of digital representation of sound! Huh? I've only studied basic DSP, but I've never heard/seen that as the b

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Lie Ryan: On 01/15/10 05:42, Alf P. Steinbach wrote: I'm beginning to believe that you maybe didn't grok that simple procedure. It's very very very trivial, so maybe you were looking for something more intricate -- they used to say, in the old days, "hold on, this proof

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Lie Ryan: On 01/15/10 05:42, Alf P. Steinbach wrote: I'm beginning to believe that you maybe didn't grok that simple procedure. It's very very very trivial, so maybe you were looking for something more intricate -- they used to say, in the old days, "hold on, this proof

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Lie Ryan: On 01/15/10 05:42, Alf P. Steinbach wrote: I'm beginning to believe that you maybe didn't grok that simple procedure. It's very very very trivial, so maybe you were looking for something more intricate -- they used to say,

Re: A simple-to-use sound file writer

2010-01-14 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: [...] Perhaps you'd also admit to being wrong, and retract your innuoendo etc.? Disregarding any matters of right or wrong (for this post, at least), I herebe retract anything I have said about you that you consider innuendo. OK. Feel fr

Re: A simple-to-use sound file writer

2010-01-15 Thread Alf P. Steinbach
* Steven D'Aprano: On Fri, 15 Jan 2010 05:23:48 +0100, Alf P. Steinbach wrote: You're again into innuendo, misleading statements and so forth. [...] [Steve Holden] prefers to spout innuendu, personal attacks and misleading statements. Your constant and repeated accusation

Re: A simple-to-use sound file writer

2010-01-15 Thread Alf P. Steinbach
* Ben Finney: "Alf P. Steinbach" writes: You did lie, that's established. In addition as I recall in the same post you went on about my motivations for doing the Terrible Deed that you invented. None of that matches my (largely disinterested) observations. This is pure fan

Re: A simple-to-use sound file writer

2010-01-15 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Ben Finney: "Alf P. Steinbach" writes: You did lie, that's established. In addition as I recall in the same post you went on about my motivations for doing the Terrible Deed that you invented. None of that matches my (largel

Re: A simple-to-use sound file writer

2010-01-15 Thread Alf P. Steinbach
* Steve Holden: For the record, yes, summing any waveforms that can be represented as Fourier Series will necessarily result in another Fourier series, since any linear combination of Fourier series must itself, be a Fourier series, and therefore the representation of the sum of the summed wavef

Re: A simple-to-use sound file writer

2010-01-15 Thread Alf P. Steinbach
* Grant Edwards: On 2010-01-15, Steve Holden wrote: I will, however, observe that your definition of a square wave is what I would have to call a "'square' wave" (and would prefer to call a "pulse train"), as I envisage a square wave as a waveform having a 50% duty cycle, as in ___ ___ |

Re: Using invalid.com email addresses

2010-01-15 Thread Alf P. Steinbach
* D'Arcy J.M. Cain: Damn! I missed the @invalid.com in the address. I'm not sure why I just didn't do this before but @invalid.com just went into my blacklist. Does anyone else think that that behaviour is just rude, not to mention in violation of the RFCs? In RFC violation yes. To saf

Re: maintain 2 versions of python on my computer

2010-01-16 Thread Alf P. Steinbach
be quoted. // Note: in order to handle Unicode paths needs to use Windows API command line. // // If this code works then it was written (but not tested) by Alf P. Steinbach. // Otherwise it's someone impersonating me. #include// std::wstring #include// std::vector

Re: A simple-to-use sound file writer

2010-01-16 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Grant Edwards: On 2010-01-15, Steve Holden wrote: I will, however, observe that your definition of a square wave is what I would have to call a "'square' wave" (and would prefer to call a "pulse train"), as I envisa

Re: A simple-to-use sound file writer

2010-01-16 Thread Alf P. Steinbach
* Alf P. Steinbach: * Steve Holden: Though for what it's worth I wasn't impressed by the results of running the posted program, since it yielded an AIFF file of mostly zeroes that produced no audible sound. $ od -bc sinewave.aiff 000 106 117 122 115 000 002 261 076 101 111 1

Re: maintain 2 versions of python on my computer

2010-01-16 Thread Alf P. Steinbach
* Gertjan Klein: Alf P. Steinbach wrote: * Gertjan Klein: What I've been thinking about is to write a single [Windows] executable that gets associated with .py and .pyw (instead of python.exe itself). Well, you need two: one for console subsystem, and one for GUI subsystem. Why? I&#

Re: maintain 2 versions of python on my computer

2010-01-16 Thread Alf P. Steinbach
* Gertjan Klein: Alf P. Steinbach wrote: * Gertjan Klein: Alf P. Steinbach wrote: Thinking about it some more, perhaps that way I can't get at return codes a python script might provide. I haven't used those, but they may be useful at some point. Return codes work OK no matter wha

<    5   6   7   8   9   10   11   12   13   14   >