Re: Good practice when writing modules...

2008-11-16 Thread bearophileHUGS
John Machin: import foo # used by baz() import bar # used by spam() Why bother with the ()? I code in other language too beside Python, in those languages there are other things (like templates in D language) beside functions, so my comment helps me remember that baz() is a function instead

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Derek Martin
On Thu, Nov 13, 2008 at 11:58:18AM -0800, [EMAIL PROTECTED] wrote: I have yet to see any reasonable definition of a Python value in the Python docs or elsewhere, despite the fact that a value is one of the three defining characteristics of an object, a central concept in Python. Why does it

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Steven D'Aprano
On Sat, 15 Nov 2008 19:41:20 -0800, rurpy wrote: I prefer another definition of object: an object *is* a value, rather than *has* a value. That value consists of identity, type (or class), and everything else of interest which is sometimes also called value. Since identity is usually

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Derek Martin
On Sun, Nov 16, 2008 at 06:06:20AM +, Steven D'Aprano wrote: * Do all objects have values? (Ignore the Python docs if necessary.) If one allows null values, I am current thinking yes. I don't see a difference between a null value and not having a value. [...] It wasn't until

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread George Sakkis
On Nov 16, 2:05 am, Arnaud Delobelle [EMAIL PROTECTED] wrote: Steven D'Aprano [EMAIL PROTECTED] writes: On Sat, 15 Nov 2008 01:40:04 -0800, Rick Giuly wrote: Hello All, Why is python designed so that b and c (according to code below) actually share the same list object? It seems more

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Derek Martin
On Sun, Nov 16, 2008 at 08:38:25AM +, Steven D'Aprano wrote: I believe that the language reference says that objects have an identity, a type and state, but I'm too lazy too look it up. I'd be happy with that definition. They do indeed say value, not state. As I said in a different

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Arnaud Delobelle
Derek Martin [EMAIL PROTECTED] writes: On Thu, Nov 13, 2008 at 11:58:18AM -0800, [EMAIL PROTECTED] wrote: I have yet to see any reasonable definition of a Python value in the Python docs or elsewhere, despite the fact that a value is one of the three defining characteristics of an object, a

Re: Good practice when writing modules...

2008-11-16 Thread John Machin
On Nov 16, 6:58 pm, [EMAIL PROTECTED] wrote: John Machin: import foo # used by baz() import bar # used by spam() Why bother with the ()? I code in other language too beside Python, in those languages there are other things (like templates in D language) beside functions, so my

Re: Win98, Python 2.5 and plotmatlib

2008-11-16 Thread W. eWatson
W. eWatson wrote: Has anyone gotten the combination of items in the Subject to work together? The pylab line here fails: from Tkinter import * from numpy import * import Image import ImageChops import ImageTk import time import binascii import tkMessageBox import tkSimpleDialog from pylab

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Derek Martin
On Sun, Nov 16, 2008 at 09:30:45AM +, Arnaud Delobelle wrote: [...] If you like, you could think of the value of an object as the set of all possible values to which the object may evaluate in every possible context, given a particular state of the object. This definition looks a bit

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Arnaud Delobelle
Derek Martin [EMAIL PROTECTED] writes: I think he meant None... Or at least, I personally see a distinction between zero and None (and so do the Python docs). Zero is a value, whereas None is specifically intended to denote the lack of any value. None is an 'value' which is intended to

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Steven D'Aprano
On Sat, 15 Nov 2008 19:42:33 -0800, rurpy wrote: You are saying there is no objective definition of value. I disagree. I think one can define value in a useful way that is precise, objective, and useful. No, I'm not saying that there is no objective definition of value. I'm saying that the

Re: Need help in understanding a python code

2008-11-16 Thread John Machin
On Nov 16, 4:15 pm, Meryl Silverburgh [EMAIL PROTECTED] wrote: This is the full source code: def A(w, v, i,j):     if i == 0 or j == 0: return 0     if w[i-1] j:  return A(w, v, i-1, j)     if w[i-1] = j: return max(A(w,v, i-1, j), v[i-1] + A(w,v, i-1, j - w[i-1])) Huh??? There is only a

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread Steven D'Aprano
On Sun, 16 Nov 2008 07:05:51 +, Arnaud Delobelle wrote: Steven D'Aprano [EMAIL PROTECTED] writes: On Sat, 15 Nov 2008 01:40:04 -0800, Rick Giuly wrote: Hello All, Why is python designed so that b and c (according to code below) actually share the same list object? It seems more

Re: Need help in understanding a python code

2008-11-16 Thread Steven D'Aprano
On Sun, 16 Nov 2008 01:50:16 -0800, John Machin wrote: def A(w, v, i,j):     if i == 0 or j == 0: return 0     if w[i-1] j:  return A(w, v, i-1, j)     if w[i-1] = j: return max(A(w,v, i-1, j), v[i-1] + A(w,v, i-1, j - w[i-1])) I am reading this blog

Re: Need help in understanding a python code

2008-11-16 Thread John Machin
On Nov 16, 9:31 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Sun, 16 Nov 2008 01:50:16 -0800, John Machin wrote: def A(w, v, i,j):     if i == 0 or j == 0: return 0     if w[i-1] j:  return A(w, v, i-1, j)     if w[i-1] = j: return max(A(w,v, i-1, j), v[i-1] +

python 2.6, MS manifest and distutils

2008-11-16 Thread David Cournapeau
Hi, I am trying to make numpy build with python 2.6 on windows, and it has been a bumpy road. Building with MS tools works OK, but building with mingw is still problematic. The problems are linked to manifest, and msvcr versions issues. Here is my understanding and how far I got: - python 2.6

Re: python 2.6, MS manifest and distutils

2008-11-16 Thread Martin v. Löwis
- msvcr 9 is not publicly available on most computers (by publicly, I mean system-wide), but python 2.6 installs its own version in the Side by Side assembly folder. Almost. If you chose just for me, then it doesn't put the CRT into SxS, but just places msvcr9.dll next to python26.dll (plus a

Re: [urllib2] No time-out?

2008-11-16 Thread Steven D'Aprano
On Sun, 16 Nov 2008 12:04:02 +0100, Gilles Ganault wrote: Hello I'm using urllib2 to download web pages. The strange thing in the code below, is that it seems like urllib2.urlopen retries indefinitely by itself instead of raising an exception: Try this instead (untested): timeout = 30

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Steven D'Aprano
On Sun, 16 Nov 2008 04:12:53 -0500, Derek Martin wrote: On Sun, Nov 16, 2008 at 06:06:20AM +, Steven D'Aprano wrote: * Do all objects have values? (Ignore the Python docs if necessary.) If one allows null values, I am current thinking yes. I don't see a difference between a

[urllib2] No time-out?

2008-11-16 Thread Gilles Ganault
Hello I'm using urllib2 to download web pages. The strange thing in the code below, is that it seems like urllib2.urlopen retries indefinitely by itself instead of raising an exception: = timeout = 30 socket.setdefaulttimeout(timeout) i = 0 while i 5:

Re: Need help in understanding a python code

2008-11-16 Thread Steven D'Aprano
On Sun, 16 Nov 2008 02:41:03 -0800, John Machin wrote: On Nov 16, 9:31 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Sun, 16 Nov 2008 01:50:16 -0800, John Machin wrote: def A(w, v, i,j):     if i == 0 or j == 0: return 0     if w[i-1] j:  return A(w, v, i-1, j)

Re: Clustering the keys of a dict according to its values

2008-11-16 Thread Gerard flanagan
Florian Brucker wrote: Florian Brucker wrote: Hi everybody! Given a dictionary, I want to create a clustered version of it, collecting keys that have the same value: d = {'a':1, 'b':2, 'c':1, 'd':1, 'e':2, 'f':3} cluster(d) {1:['a', 'c', 'd'], 2:['b', 'e'], 3:['f']} That is, generate

Re: Need help in understanding a python code

2008-11-16 Thread John Machin
On Nov 16, 11:04 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Sun, 16 Nov 2008 02:41:03 -0800, John Machin wrote: On Nov 16, 9:31 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Sun, 16 Nov 2008 01:50:16 -0800, John Machin wrote: def A(w, v,

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread Steve Holden
George Sakkis wrote: On Nov 16, 2:05 am, Arnaud Delobelle [EMAIL PROTECTED] wrote: Steven D'Aprano [EMAIL PROTECTED] writes: On Sat, 15 Nov 2008 01:40:04 -0800, Rick Giuly wrote: Hello All, Why is python designed so that b and c (according to code below) actually share the same list

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread Steve Holden
Dennis Lee Bieber wrote: On Sat, 15 Nov 2008 01:40:04 -0800 (PST), Rick Giuly [EMAIL PROTECTED] declaimed the following in comp.lang.python: Why is python designed so that b and c (according to code below) actually share the same list object? It seems more natural to me that each object

Log Manager application: are there components already built ?

2008-11-16 Thread Barak, Ron
Hi Guys, I need to create a Log Manager application that is able to accept log files with various line (e.g., error messages) formatting, and create log objects that could be put into a data-base. Some of the requirements of this Log Manager, from the perspective of a client program would be:

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Steve Holden
Steven D'Aprano wrote: On Sat, 15 Nov 2008 19:42:33 -0800, rurpy wrote: [...] But I propose that one can define value in a precise way that captures what most people think of as value, and avoids confusing objects (or references to them) and the value of objects. Good luck. I think you're

Re: Building musical chords starting from (a lot of) rules

2008-11-16 Thread Mr . SpOOn
On Sun, Nov 16, 2008 at 7:21 AM, Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: In message [EMAIL PROTECTED], Mr.SpOOn wrote: C 9 is a base chord plus a the ninth note, but this implies the presence of the seventh too, so it results in: C E G B D I don't recall such meanings in the chord

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Steve Holden
Steven D'Aprano wrote: On Sat, 15 Nov 2008 11:17:07 -0800, rurpy wrote: [...] * How can I find an object's value (if I don't believe .str(), .repr(), etc)? Use gdb. :-) I would say the object's value is the value, so if you have the object, you have its value. [...] There's also the

Is this optparse object abuse?

2008-11-16 Thread John O'Hagan
Hello, I've recently found it convenient to do something like this: options = optparse_function(sys.argv[1:]) ##print options = ##{option_one:4, option_two:[5, 3, 7, 8, 6], option_three:'/home/files'} #(Note that this is not a dictionary, even though it looks like one; it's how #an optparse

Re: Is this optparse object abuse?

2008-11-16 Thread Diez B. Roggisch
In other words, using the optparse object to hold as attributes everything needed by all the functions and methods in the module, and simply passing it holus bolus to all them and just pulling out what's actually needed inside the function, even adding new attributes or reassigning old ones

best gcc version for Python

2008-11-16 Thread Robin Becker
I've just been testing out Jakob Sievers' speedup of Python 2.5.2 by compiling on freebsd with gcc-4.3.3 (the standard freebsd 6.1 gcc is 3.4.4). I'm glad to say that his modification did improve pybench overall by about 12%, but during the testing I noticed that in fact some of the pybench

Re: best gcc version for Python

2008-11-16 Thread Christian Heimes
Robin Becker wrote: I've just been testing out Jakob Sievers' speedup of Python 2.5.2 by compiling on freebsd with gcc-4.3.3 (the standard freebsd 6.1 gcc is 3.4.4). I'm glad to say that his modification did improve pybench overall by about 12%, but during the testing I noticed that in fact

Re: special editor support for indentation needed.

2008-11-16 Thread Steve Holden
Eric S. Johansson wrote: Aaron Brady wrote: [...] one step up from speaking the keyboard is forcing the user to say the same command multiple times to achieve a single effect. For example, if you want to move to the beginning of the line for the end of the line, you can say move word left

MailingLogger 3.2.2 Released!

2008-11-16 Thread Chris Withers
I'm pleased to announce a new release of Mailinglogger that finally correctly supports easy_install and so works fine with zc.buildout-based projects. In fact, MailingLogger has *become* a zc.buildout-based project for its development... Anyway, Mailinglogger provides two handlers for the

Wild cards for comparison

2008-11-16 Thread Foster, Richard
I am trying to update a program to search for two servers instead of 1 and I am having problems. The two servers are blah1-gt1 and blah2-gp1 It has been working as shown in the example below: Ex x=blah1-gt1 I tried x=*-g*1 And it did not work. I have imported both the glob and

Re: How to make arrays from Lists

2008-11-16 Thread Michiel Overtoom
[EMAIL PROTECTED] wrote: x = [[0] * ncols for i in nrows] That gives an error... small typo corrected: y = [[0] * ncols for i in range(nrows)] Greetings, -- The ability of the OSS process to collect and harness the collective IQ of thousands of individuals across the Internet is simply

[no subject]

2008-11-16 Thread anish mathew
pls help me        html page conecting to database sql or .mdb files     pls sent qury Check out the all-new face of Yahoo! India. Go to http://in.yahoo.com/-- http://mail.python.org/mailman/listinfo/python-list

Re: about escape string store in mysql

2008-11-16 Thread MRAB
On Nov 16, 7:05 am, [EMAIL PROTECTED] wrote: this string from web by the Regular Expression, −−− href=# onClick=ConvertURL2FG('Flashget:// W0ZMQVNIR0VUXWh0dHA6Ly9tb3YuM2dwLmNuL2d1aWxpbi8yMDA4LzExLzExL3l1ZWhvdWppZmVuMDIuM2dwW0ZMQVNIR0VUXQ==233','', 233)

Re:

2008-11-16 Thread Benjamin Kaplan
On Wed, Nov 12, 2008 at 4:02 AM, anish mathew [EMAIL PROTECTED]wrote: pls help me html page conecting to database sql or .mdb files pls sent qury I know that English may not be your first language, but please make an effort to use proper English. Your question isn't really

Re: Little direction please Python MySQL

2008-11-16 Thread Tino Wildenhain
Bruno Desthuilliers wrote: len a écrit : Hi all; I am looking for a little direction in moving from novice python MySQL to real world processing. I can connect to MySQL databases and have performed most of the various select, create, update, insert, etc given the examples in the various books

Win 98 --Is 2.4.x The last version of Python for It?

2008-11-16 Thread W. eWatson
-- W. eWatson (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7 N, 121° 2' 32 W, 2700 feet Web Page: www.speckledwithstars.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Win 98 --Is 2.4.x The last version of Python for It?

2008-11-16 Thread Benjamin Kaplan
For x86 processors: python-2.5.2.msihttp://www.python.org/ftp/python/2.5.2/python-2.5.2.msi For Win64-Itanium users: python-2.5.2.ia64.msihttp://www.python.org/ftp/python/2.5.2/python-2.5.2.ia64.msi For Win64-AMD64 users:

Re: Is this optparse object abuse?

2008-11-16 Thread John O'Hagan
On Sun, 16 Nov 2008, Diez B. Roggisch wrote: In other words, using the optparse object to hold as attributes everything needed by all the functions and methods in the module, and simply passing it holus bolus to all them and just pulling out what's actually needed inside the function, even

Customizing sequence types

2008-11-16 Thread Mr . SpOOn
Hi, I'm trying to create a class which inherit a list to change some behavior. This list should contain other instance objects and has to manage these instances in a particular way. 1) I need to sort this elements in this list, but they must be sorted using an instance variable. What does Python

Re: Win 98 --Is 2.4.x The last version of Python for It?

2008-11-16 Thread Christian Heimes
Python 2.5 is the last version for Win9x and NT. Starting with Python 2.6 and 3.0 at least Windows 2000 SP4 is required. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: C Function Pointer Wrapping Example not working

2008-11-16 Thread Nick Craig-Wood
Charlie [EMAIL PROTECTED] wrote: I am new to using swig/C++/python. I got some problem with function pointers. I posted in swig-user, but got no response. So I forwarded it here. You help is greatly appreciated. Thanks! Hi All, Yesterday I posted about the question I had of

Re: Win 98 --Is 2.4.x The last version of Python for It?

2008-11-16 Thread Gabriel Genellina
En Sun, 16 Nov 2008 13:46:03 -0200, W. eWatson [EMAIL PROTECTED] escribió: Win 98 --Is 2.4.x The last version of Python for It? No, 2.5 still works on W98, 2.6 doesn't. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Have you ever used pydiction?

2008-11-16 Thread 一首诗
Hi all, Recently I am writing more codes in python with vim so I made some search for python auto completion plugins. Finally I found pydcition: http://www.vim.org/scripts/script.php?script_id=850 Anyway, it works. But I met one problem. After you have set isk+=.,( The dot . becomes

re.match and non-alphanumeric characters

2008-11-16 Thread The Web President
Dear all, this is really driving me nuts and any help would be extremely appreciated. I have a string that contains some numeric data. I want to isolate these data using re.match, as follows. bogus = IFC(35m) data = re.match(r'(\d+)',bogus) print data.group(1) I would expect to have 35 printed

Re: Is this optparse object abuse?

2008-11-16 Thread Diez B. Roggisch
John O'Hagan wrote: On Sun, 16 Nov 2008, Diez B. Roggisch wrote: In other words, using the optparse object to hold as attributes everything needed by all the functions and methods in the module, and simply passing it holus bolus to all them and just pulling out what's actually needed

Does python is suitable for enterprise cluster management?

2008-11-16 Thread Asaf Hayman
Is anyone familiar or aware of a successful enterprise class project in Python to control and monitor a cluster of computers? As a part of a bigger project my company needs to build a cluster management system. The aim of the system is to control and synchronize applications. Namely, a central

Re: Building musical chords starting from (a lot of) rules

2008-11-16 Thread bvdp
Mr.SpOOn wrote: So for example in jazz music it is more common the minor seventh than the major, so writing just G7 you mean the dominant seventh chord (with minor seventh) and you have to write just the major one with maj7. A minor 7th has a flatted 3rd (ie. C, Eb, G, Bb). Don't confuse your

Re: re.match and non-alphanumeric characters

2008-11-16 Thread r
On Nov 16, 10:33 am, The Web President [EMAIL PROTECTED] wrote: Dear all, this is really driving me nuts and any help would be extremely appreciated. I have a string that contains some numeric data. I want to isolate these data using re.match, as follows. bogus = IFC(35m) data =

Re: re.match and non-alphanumeric characters

2008-11-16 Thread MRAB
On Nov 16, 4:33 pm, The Web President [EMAIL PROTECTED] wrote: Dear all, this is really driving me nuts and any help would be extremely appreciated. I have a string that contains some numeric data. I want to isolate these data using re.match, as follows. bogus = IFC(35m) data =

Re: re.match and non-alphanumeric characters

2008-11-16 Thread Gabriel Genellina
En Sun, 16 Nov 2008 14:33:42 -0200, The Web President [EMAIL PROTECTED] escribió: I have a string that contains some numeric data. I want to isolate these data using re.match, as follows. bogus = IFC(35m) data = re.match(r'(\d+)',bogus) print data.group(1) I would expect to have 35 printed

python script to act as list server

2008-11-16 Thread William Gill
Before I spend the next couple weeks researching and testing, can anyone tell me if what I want to do is possible, and possibly point me in the right direction to get started. I want to forward any email addressed to [EMAIL PROTECTED] to a python script that will forward it to all the other

Re: python script to act as list server

2008-11-16 Thread Benjamin Kaplan
On Sun, Nov 16, 2008 at 12:05 PM, William Gill [EMAIL PROTECTED] wrote: Before I spend the next couple weeks researching and testing, can anyone tell me if what I want to do is possible, and possibly point me in the right direction to get started. I want to forward any email addressed to

Re: Good practice when writing modules...

2008-11-16 Thread Nick Craig-Wood
r0g [EMAIL PROTECTED] wrote: I'm collecting together a bunch of fairly random useful functions I have written over the years into a module. Generally speaking is it best to a) Import all the other modules these functions depend on into the modules global namespace by putting them at the

Re: Little direction please Python MySQL

2008-11-16 Thread len
On Nov 15, 4:41 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Sat, 15 Nov 2008 11:41:17 -0800, Ethan Furman [EMAIL PROTECTED] declaimed the following in comp.lang.python: len wrote:         snip Files are fixed format no field delimiters, fields are position and length

Newbie code review of parsing program Please

2008-11-16 Thread len
I have created the following program to read a text file which happens to be a cobol filed definition. The program then outputs to a file what is essentially a file which is a list definition which I can later copy and past into a python program. I will eventually expand the program to also

Re: re.match and non-alphanumeric characters

2008-11-16 Thread Diez B. Roggisch
The Web President wrote: Dear all, this is really driving me nuts and any help would be extremely appreciated. I have a string that contains some numeric data. I want to isolate these data using re.match, as follows. bogus = IFC(35m) data = re.match(r'(\d+)',bogus) print

Re: special editor support for indentation needed.

2008-11-16 Thread Aahz
In article [EMAIL PROTECTED], Eric S. Johansson [EMAIL PROTECTED] wrote: here's an example of the problem: class foo( object): def cat(self) self.x=1 def dog self.x=2 this is legal Python but it's not what you need 99% of the time. There is no cue to the editor to

Re: about escape string store in mysql

2008-11-16 Thread Steve Holden
MRAB wrote: On Nov 16, 7:05 am, [EMAIL PROTECTED] wrote: this string from web by the Regular Expression, −−− href=# onClick=ConvertURL2FG('Flashget://

Re: Customizing sequence types

2008-11-16 Thread Steve Holden
Mr.SpOOn wrote: Hi, I'm trying to create a class which inherit a list to change some behavior. This list should contain other instance objects and has to manage these instances in a particular way. 1) I need to sort this elements in this list, but they must be sorted using an instance

Re: Customizing sequence types

2008-11-16 Thread Chris Rebert
On Sun, Nov 16, 2008 at 8:16 AM, Mr. SpOOn [EMAIL PROTECTED] wrote: Hi, I'm trying to create a class which inherit a list to change some behavior. This list should contain other instance objects and has to manage these instances in a particular way. 1) I need to sort this elements in this

Re: Customizing sequence types

2008-11-16 Thread Arnaud Delobelle
Mr.SpOOn [EMAIL PROTECTED] writes: Hi, I'm trying to create a class which inherit a list to change some behavior. This list should contain other instance objects and has to manage these instances in a particular way. 1) I need to sort this elements in this list, but they must be sorted

Re: Does python is suitable for enterprise cluster management?

2008-11-16 Thread Steve Holden
Asaf Hayman wrote: Is anyone familiar or aware of a successful enterprise class project in Python to control and monitor a cluster of computers? As a part of a bigger project my company needs to build a cluster management system. The aim of the system is to control and synchronize

Re: Customizing sequence types

2008-11-16 Thread Mr . SpOOn
On Sun, Nov 16, 2008 at 7:15 PM, Arnaud Delobelle [EMAIL PROTECTED] wrote: Mr.SpOOn [EMAIL PROTECTED] writes: Hi, I'm trying to create a class which inherit a list to change some behavior. This list should contain other instance objects and has to manage these instances in a particular way.

Re: Newbie code review of parsing program Please

2008-11-16 Thread Mark Tolonen
len [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have created the following program to read a text file which happens to be a cobol filed definition. The program then outputs to a file what is essentially a file which is a list definition which I can later copy and past into a

Re: Newbie code review of parsing program Please

2008-11-16 Thread len
On Nov 16, 12:40 pm, Mark Tolonen [EMAIL PROTECTED] wrote: len [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have created the following program to read a text file which happens to be a cobol filed definition.  The program then outputs to a file what is essentially a

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread George Sakkis
On Nov 16, 8:28 am, Steve Holden [EMAIL PROTECTED] wrote: +1. Understanding and accepting the current behavior (mainly because of the extra performance penalty of evaluating the default expressions on every call would incur) is one thing, claiming that it is somehow natural is plain

Midi manipulation

2008-11-16 Thread Massi
Hi everyone, I'm searching for something which allows me to write scripts which handle midi files. I'm totally a newbie in audio manipulation, therefore any suggestion or link related to this field is welcome. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie code review of parsing program Please

2008-11-16 Thread Steve Holden
Mark Tolonen wrote: len [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [...] You might want to check out the pyparsing library. And you might want to trim your messages to avoid quoting irrelevant stuff. This is not directed personally at Mark, but at all readers. Loads of us

Re: Need help in understanding a python code

2008-11-16 Thread George Sakkis
On Nov 16, 7:34 am, John Machin [EMAIL PROTECTED] wrote: On Nov 16, 11:04 pm, Steven D'Aprano [EMAIL PROTECTED] http://en.wikipedia.org/wiki/Style_over_substance_fallacy Quoted Wikipedia - instant disqualification - you lose. Good night. When quoting wikipedia became the new Godwin's law ??

Re: Is this optparse object abuse?

2008-11-16 Thread Bruno Desthuilliers
John O'Hagan a écrit : Hello, I've recently found it convenient to do something like this: (snip) In other words, using the optparse object to hold as attributes everything needed by all the functions and methods in the module, and simply passing it holus bolus to all them and just pulling

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread Chris Rebert
On Sun, Nov 16, 2008 at 11:02 AM, George Sakkis [EMAIL PROTECTED] wrote: On Nov 16, 8:28 am, Steve Holden [EMAIL PROTECTED] wrote: +1. Understanding and accepting the current behavior (mainly because of the extra performance penalty of evaluating the default expressions on every call would

Re: Clustering the keys of a dict according to its values

2008-11-16 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Bruno Desthuilliers: What is data is another type of sequence or iterable ?-) The original problem statement was: I did read it, thanks. If the problem changes, then the code has to/can change. When you write code it's better to avoid over-generalization

Re: Does python is suitable for enterprise cluster management?

2008-11-16 Thread bearophileHUGS
Asaf Hayman: We are currently pondering which programming language will best suite us. The two major contenders are Python and Java. I think there is also Erlang for such kind of things. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Does python is suitable for enterprise cluster management?

2008-11-16 Thread Aahz
In article [EMAIL PROTECTED], Asaf Hayman [EMAIL PROTECTED] wrote: Is anyone familiar or aware of a successful enterprise class project in Python to control and monitor a cluster of computers? Ever heard of Google? ;-) -- Aahz ([EMAIL PROTECTED]) *

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread George Sakkis
On Nov 16, 2:30 pm, Chris Rebert [EMAIL PROTECTED] wrote: On Sun, Nov 16, 2008 at 11:02 AM, George Sakkis [EMAIL PROTECTED] wrote: On Nov 16, 8:28 am, Steve Holden [EMAIL PROTECTED] wrote: Less obvious is entirely in the mind of the reader. Without documentation or peeking into the

Re: re.match and non-alphanumeric characters

2008-11-16 Thread John Machin
On Nov 17, 4:44 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: Match matches the whole string. *ONLY* if the pattern ends with $ or r\Z -- http://mail.python.org/mailman/listinfo/python-list

C extension - new and init functions

2008-11-16 Thread Paul Moore
I have a C extension type, Pattern, where my type manages a dynamically allocated memory block (of instructions, the details aren't important). The basic constructor builds a pattern with a single instruction (End) as follows: static PyObject * Pattern_new(PyTypeObject *type, PyObject *args,

Re: Generators and their next() and send() methods

2008-11-16 Thread Thomas Mlynarczyk
Arnaud Delobelle schrieb: If you want to simply 'set' the generator (by which I take you mean 'change its state') without without iterating it one step, then what you need is a class with an __iter__() method. Then you can change the state of the object between calls to next(). E.g. class

Re: Midi manipulation

2008-11-16 Thread Alia Khouri
On Nov 16, 10:17 pm, Massi [EMAIL PROTECTED] wrote: Hi everyone, I'm searching for something which allows me to write scripts which handle midi files. I'm totally a newbie in audio manipulation, therefore any suggestion or link related to this field is welcome. Thanks in advance.

Re: Midi manipulation

2008-11-16 Thread Tim Roberts
Massi [EMAIL PROTECTED] wrote: Hi everyone, I'm searching for something which allows me to write scripts which handle midi files. I'm totally a newbie in audio manipulation, therefore any suggestion or link related to this field is welcome. Thanks in advance. Google is much faster than this

Re: re.match and non-alphanumeric characters

2008-11-16 Thread Diez B. Roggisch
John Machin schrieb: On Nov 17, 4:44 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: Match matches the whole string. *ONLY* if the pattern ends with $ or r\Z You think so? import re rex = re.compile(abc.*def) if rex.match(abc0123455678def): print matched Diez --

Re: Test if list contains another list

2008-11-16 Thread Ali
Its funny, I just visited this problem last week. http://dulceetutile.blogspot.com/2008/11/strange-looking-python- statement_17.html ./Ali -- http://mail.python.org/mailman/listinfo/python-list

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread rurpy
Since many responses to my definition of value raised similar points, I will try and respond generally here. In hindsight, I should not have used the word value; it is far too overloaded with preexisting semantics for me to have attempted to redefine it, even if it is the word used (but not

ANN: PySmell 0.7.2 released, many TextMate improvements

2008-11-16 Thread Orestis Markou
I'm very proud to announce the release of PySmell v0.7.2, now with extra goodness. Changes: * TextMate's dialog no longer errors when dealing with a huge number of entries. * New --input allows mutation of existing PYSMELLTAGS file; useful to run after a file is saved * Analyze the

Re: re.match and non-alphanumeric characters

2008-11-16 Thread Steve Holden
Diez B. Roggisch wrote: John Machin schrieb: On Nov 17, 4:44 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: Match matches the whole string. *ONLY* if the pattern ends with $ or r\Z You think so? import re rex = re.compile(abc.*def) if rex.match(abc0123455678def): print

Re: re.match and non-alphanumeric characters

2008-11-16 Thread John Machin
On Nov 17, 10:19 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: John Machin schrieb: On Nov 17, 4:44 am, Diez B. Roggisch [EMAIL PROTECTED] wrote:  Match matches the whole string. *ONLY* if the pattern ends with $ or r\Z You think so? import re rex = re.compile(abc.*def) if

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Steve Holden
[EMAIL PROTECTED] wrote: Since many responses to my definition of value raised similar points, I will try and respond generally here. In hindsight, I should not have used the word value; it is far too overloaded with preexisting semantics for me to have attempted to redefine it, even if

Re: Generators and their next() and send() methods

2008-11-16 Thread alex23
On Nov 17, 7:36 am, Thomas Mlynarczyk [EMAIL PROTECTED] wrote: Still, I would like to know why it was decided to introduce a send() method instead of allowing an argument for next(). Hey Thomas, A great place to gain insight into the reasoning behind changes to Python is the PEPs:

Re: Need help in understanding a python code

2008-11-16 Thread alex23
On Nov 17, 5:26 am, George Sakkis [EMAIL PROTECTED] wrote: When quoting wikipedia became the new Godwin's law ?? :) Probably at the point the editors started becoming revisionists and culling anything they didn't consider notable enough. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python IF THEN chain equivalence

2008-11-16 Thread Steve Holden
jzakiya wrote: On Nov 13, 5:48 pm, M.-A. Lemburg [EMAIL PROTECTED] wrote: On 2008-11-13 23:31, jzakiya wrote: On Nov 13, 5:21 pm, Alan Baljeu [EMAIL PROTECTED] wrote: I think you should rethink your post. The first case you posted makes no sense in any language I know. Also, a whole lot

Re: Need help in understanding a python code

2008-11-16 Thread Benjamin Kaplan
On Sun, Nov 16, 2008 at 7:34 AM, John Machin [EMAIL PROTECTED] wrote: On Nov 16, 11:04 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Sun, 16 Nov 2008 02:41:03 -0800, John Machin wrote: On Nov 16, 9:31 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote:

Re: Need help in understanding a python code

2008-11-16 Thread Matt Nordhoff
Benjamin Kaplan wrote: If you really believe that, you haven't been following this list long enough. Every terminology dispute always includes at least 1 Wikipedia link. Also, you might want to look at this study: http://news.cnet.com/2100-1038_3-5997332.html That study has been disputed;

Very simple WSGI question

2008-11-16 Thread Matthew Wilson
I want to write some middleware to notice when the inner app returns a 500 status code. I'm sure there are already sophisticated loggers that do this sort of thing, but I'm using this as a learning exercise. Right now, I wrapped the start_response callable. So when the WSGI application calls

  1   2   >