Re: Python 3.0 automatic decoding of UTF16

2008-12-05 Thread J Kenneth King
Johannes Bauer [EMAIL PROTECTED] writes: Traceback (most recent call last): File ./modify.py, line 12, in module a = AddressBook(2008_11_05_Handy_Backup.txt) File ./modify.py, line 7, in __init__ line = f.readline() File /usr/local/lib/python3.0/io.py, line 1807, in readline

Re: RELEASED Python 3.0 final

2008-12-04 Thread J Kenneth King
Barry Warsaw [EMAIL PROTECTED] writes: On behalf of the Python development team and the Python community, I am happy to announce the release of Python 3.0 final. Yay! Thanks for all the great work. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python equivalent of Common Lisp Macros?

2008-11-26 Thread J Kenneth King
dpapathanasiou [EMAIL PROTECTED] writes: I'm using the feedparser library to extract data from rss feed items. After I wrote this function, which returns a list of item titles, I noticed that most item attributes would be retrieved the same way, i.e., the function would look exactly the

Re: function parameter scope python 2.5.2

2008-11-21 Thread J Kenneth King
alex23 [EMAIL PROTECTED] writes: On Nov 21, 9:40 am, J Kenneth King [EMAIL PROTECTED] wrote: Of course, providing a shallow (or deep as necessary) copy makes it work, I'm curious as to why the value passed as a parameter to a function outside the class is passed a reference rather than a copy

Re: function parameter scope python 2.5.2

2008-11-21 Thread J Kenneth King
Steven D'Aprano [EMAIL PROTECTED] writes: On Thu, 20 Nov 2008 18:31:12 -0500, J Kenneth King wrote: Of course I expected that recursive_func() would receive a copy of weird_obj.words but it appears to happily modify the object. I am curious why you thought that. What made you think Python

Re: function parameter scope python 2.5.2

2008-11-21 Thread J Kenneth King
Peter Pearson [EMAIL PROTECTED] writes: On Fri, 21 Nov 2008 10:12:08 -0500, J Kenneth King wrote: Steven D'Aprano [EMAIL PROTECTED] writes: I am curious why you thought that. What made you think Python should/did make a copy of weird_obj.words when you pass it to a function? [snip

function parameter scope python 2.5.2

2008-11-20 Thread J Kenneth King
I recently encountered some interesting behaviour that looks like a bug to me, but I can't find the appropriate reference to any specifications to clarify whether it is a bug. Here's the example code to demonstrate the issue: class SomeObject(object): def __init__(self): self.words

Re: function parameter scope python 2.5.2

2008-11-20 Thread J Kenneth King
J Kenneth King [EMAIL PROTECTED] writes: I recently encountered some interesting behaviour that looks like a bug to me, but I can't find the appropriate reference to any specifications to clarify whether it is a bug. Here's the example code to demonstrate the issue: class SomeObject(object

Re: Multiprocessing vs. [Pyro, RPyC]

2008-11-15 Thread J Kenneth King
Jeffrey Barish [EMAIL PROTECTED] writes: [EMAIL PROTECTED] wrote: Jeffrey With the release of multiprocessing in Python 2.6, is there any Jeffrey reason to use Pyro or RPyC? As far as I know the multiprocessing module only works on one machine (multi-cpu or multi-core), not

Re: duck-type-checking?

2008-11-12 Thread J Kenneth King
Joe Strout [EMAIL PROTECTED] writes: Let me preface this by saying that I think I get the concept of duck- typing. However, I still want to sprinkle my code with assertions that, for example, my parameters are what they're supposed to be -- too often I mistakenly pass in something I

Re: best python unit testing framwork

2008-11-11 Thread J Kenneth King
Brendan Miller [EMAIL PROTECTED] writes: What would heavy python unit testers say is the best framework? I've seen a few mentions that maybe the built in unittest framework isn't that great. I've heard a couple of good things about py.test and nose. Are there other options? Is there any kind

Re: Daemon and logging - the best approach?

2008-11-07 Thread J Kenneth King
Lech Karol Pawłaszek [EMAIL PROTECTED] writes: Hello. I'm trying to make a daemon and I want to log to a file its activity. I'm using logging module with a configuration file for it (loaded via fileConfig()). And now I want to read logging config file before daemonize the program because

Re: Python suitable for Midi ?

2008-10-29 Thread J Kenneth King
Derek Martin [EMAIL PROTECTED] writes: On Tue, Oct 28, 2008 at 06:54:57PM +0200, Chuckk Hubbard wrote: The problem I've run into is that I can't set the audio to a higher priority than the GUI (Tkinter). If I move the mouse over the app, no matter what, I get audio dropouts. AFAICT this is

Re: python extensions: including project local headers

2008-10-24 Thread J Kenneth King
Philip Semanchuk [EMAIL PROTECTED] writes: On Oct 23, 2008, at 3:18 PM, J Kenneth King wrote: Philip Semanchuk [EMAIL PROTECTED] writes: On Oct 23, 2008, at 11:36 AM, J Kenneth King wrote: Hey everyone, I'm working on a python extension wrapper around Rob Hess' implementation of a SIFT

python extensions: including project local headers

2008-10-23 Thread J Kenneth King
Hey everyone, I'm working on a python extension wrapper around Rob Hess' implementation of a SIFT feature detector. I'm working on a computer-vision based project that requires interfacing with Python at the higher layers, so I figured the best way to handle this would be in C (since my initial

Re: python extensions: including project local headers

2008-10-23 Thread J Kenneth King
Robert Kern [EMAIL PROTECTED] writes: Philip Semanchuk wrote: On Oct 23, 2008, at 11:36 AM, J Kenneth King wrote: Hey everyone, I'm working on a python extension wrapper around Rob Hess' implementation of a SIFT feature detector. I'm working on a computer-vision based project

Re: python extensions: including project local headers

2008-10-23 Thread J Kenneth King
Philip Semanchuk [EMAIL PROTECTED] writes: On Oct 23, 2008, at 11:36 AM, J Kenneth King wrote: Hey everyone, I'm working on a python extension wrapper around Rob Hess' implementation of a SIFT feature detector. I'm working on a computer-vision based project that requires interfacing

Re: PYTHON WORKING WITH PERL ??

2008-10-16 Thread J Kenneth King
Pat [EMAIL PROTECTED] writes: Sean DiZazzo wrote: On Sep 29, 12:44 pm, Blubaugh, David A. [EMAIL PROTECTED] wrote: Sir, You are absolutely correct. I was praying to G_d I did not have to slaughter my project's source code in this manner. However, like life itself, I was given legacy

Re: PYTHON WORKING WITH PERL ??

2008-10-16 Thread J Kenneth King
Joshua Kugler [EMAIL PROTECTED] writes: Pat wrote: Rewrite everything in python. Save yourself now...while you still can. ~Sean Trust me. Sean is absolutely correct. I'm currently in the process of converting a large Perl project to Python (and learning Python at the same time) and

Re: PIL problem

2008-10-08 Thread J Kenneth King
bfrederi [EMAIL PROTECTED] writes: I am having a problem using PIL. I am trying to crop and image to a square, starting from the center of the image, but when I try to crop the image, it won't crop. Here are the relevant code snippets: ### Function I am testing ### def

<    1   2