Re: Cannot install pysqlite on Cygwin

2008-09-29 Thread Gerhard Häring
Tilman Kispersky wrote: I am trying to install sqlite for use with python on cygwin. I have installed the sqlite packages from cygwin (that is libsqlite3-devel and libsqlite3_0). When attempting to easy_install pysqlite I get: [...] build/temp.cygwin-1.5.25-i686-2.5/src/connection.o: In function

Detecting dir (tree) changes fast?

2008-09-29 Thread robert
I want to detect changes in a directory tree fast with minimum overhead/load. In order to check the need for sync tasks at high frequency. It must not be 100% reliable (its also forced time periodic), so kind of hashing would be ok. How? Robert -- http://mail.python.org/mailman/listinfo/pytho

Re: Detecting dir (tree) changes fast?

2008-09-29 Thread Christian Heimes
robert wrote: I want to detect changes in a directory tree fast with minimum overhead/load. In order to check the need for sync tasks at high frequency. It must not be 100% reliable (its also forced time periodic), so kind of hashing would be ok. How? Almost every modern OS has some sort of s

Re: Detecting dir (tree) changes fast?

2008-09-29 Thread Steven D'Aprano
On Mon, 29 Sep 2008 10:05:10 +0200, robert wrote: > I want to detect changes in a directory tree fast with minimum > overhead/load. In order to check the need for sync tasks at high > frequency. > It must not be 100% reliable (its also forced time periodic), so kind of > hashing would be ok. > How

Re: Python is slow?

2008-09-29 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, sturlamolden wrote: > ... and possibility of interfacing with gnuplot ... Gnuplot is non-Free software. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-29 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, D'Arcy J.M. Cain wrote: > On Fri, 26 Sep 2008 11:00:59 -0500 > "Michael Mabin" <[EMAIL PROTECTED]> wrote: > >> So we can drop a table in an in clause? How is this a use case. >> Cartoons are funny but actual proof that this example using an in-clause >> provides a

Re: how to search multiple textfiles ? (Python is slow ?)

2008-09-29 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Stef Mientki wrote: > - Pyscripter 110 sec ( PyScripter is the default IDE I use now) > - Delphi 20 .. 35 sec > - Findstr 4 sec What order did you try try them in? Did you try each one more than once, in different orders? Just to rule out filesystem caching effec

Re: how to search multiple textfiles ?

2008-09-29 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, George Sakkis wrote: > $ find -name "*py" | xargs egrep "\bword\b" Better: find -name '*.py' -exec grep -E "\bword\b" {} \; -- http://mail.python.org/mailman/listinfo/python-list

Re: Python style: exceptions vs. sys.exit()

2008-09-29 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Ross Ridge wrote: > You need either use trial and error to find out, or look at the source. So what's wrong with using the source as documentation? :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Test if list contains another list

2008-09-29 Thread bearophileHUGS
Derek Martin: >Quite a lot faster than mine... even without using psyco.< It's designed for Psyco. >However they don't appear to buy you much, given that the cases they optimize >would probably be rare, and the difference in execution time gained by the >optimization is not noticable to the us

Re: how to make smtplib.SMTP('localhost') work on window xp

2008-09-29 Thread zxo102
On 9月29日, 下午2时53分, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message > <[EMAIL PROTECTED]>, zxo102 > wrote: > > > SMTPServerDisconnected: Connection unexpectedly closed > > Does the SMTP server on localhost mention anything about the connection > attempt in its log

Re: how to make smtplib.SMTP('localhost') work on window xp

2008-09-29 Thread Steve Holden
zxo102 wrote: > Hi, > I am trying to use python module smtplib to send my email out on > window xp (localhost). > > import smtplib > server = smtplib.SMTP('localhost') > > but I got the error information as follows: > > Traceback (most recent call last): > File "", line 1, in ? > File "c:\p

Re: cups.Connection.printFile

2008-09-29 Thread Antoon Pardon
On 2008-09-26, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Sep 19, 9:01 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: >> On 2008-09-16, Graham Jenkins <[EMAIL PROTECTED]> wrote: >> >> >> >> > I'm trying to print a file from within a Python program. >> >> > The quick-and-dirty solution is to use so

Re: cups.Connection.printFile

2008-09-29 Thread Tim Golden
Antoon Pardon wrote: On 2008-09-26, Mike Driscoll <[EMAIL PROTECTED]> wrote: On Sep 19, 9:01 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: On 2008-09-16, Graham Jenkins <[EMAIL PROTECTED]> wrote: I'm trying to print a file from within a Python program. The quick-and-dirty solution is to use

Re: generate random digits with length of 5

2008-09-29 Thread dusans
On Sep 29, 12:06 am, Mensanator <[EMAIL PROTECTED]> wrote: > On Sep 28, 3:54 pm, "Aaron \"Castironpi\" Brady" > > > > > > <[EMAIL PROTECTED]> wrote: > > On Sep 28, 3:44 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > On Sep 28, 3:11 pm, "Gary M. Josack" <[EMAIL PROTECTED]> wrote: > > > > > Chris

Re: Spring Python 0.7.0 is released

2008-09-29 Thread Goldfish
Key Features The following features have been implemented: * Inversion Of Control - The idea is to decouple two classes at the interface level. This lets you build many reusable parts in your software, and your whole application becomes more pluggable. You can use either the XmlApplicationCon

Re: What is not objects in Python?

2008-09-29 Thread George Sakkis
On Sep 29, 2:34 am, Carl Banks <[EMAIL PROTECTED]> wrote: > On Sep 29, 1:44 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > > On Sep 29, 12:08 am, Terry Reedy <[EMAIL PROTECTED]> wrote: > > > > George Sakkis wrote: > > > > On Sep 28, 2:29 pm, process <[EMAIL PROTECTED]> wrote: > > > > >> I hav

Re: What is not objects in Python?

2008-09-29 Thread bearophileHUGS
George Sakkis: > I don't see the same value in creating a distinction between methods > and builtin functions unless the latter are truly generic (and even > then I wouldn't mind having them as methods of the base object class, > e.g. object.type()). Having a builtin len(x) delegate to x.__len__()

writing dll in python?

2008-09-29 Thread nishalrs
Hello All, My main motivation is to build a collection of useful mathematical models (that I have developed over the years) to design ultrasonic sensors. This should be some sort of a library that should be able to be used for desktop/web application development, to run in variety of operating sys

Re: Fastest way to max() list

2008-09-29 Thread Gabriel Genellina
En Fri, 26 Sep 2008 01:42:59 -0300, Chris Rebert <[EMAIL PROTECTED]> escribió: B. Assuming by "distance" you meant "difference" and/or that the distance is only in 1 dimension: from operator import itemgetter firsts = map(itemgetter(0), main_list) distance = max(firsts) - min(firsts) I thin

SPECIAL DISCOUNTS - Online Python Training

2008-09-29 Thread Jeanne Allen
Do you know anyone who is looking for training on Python? We have two courses taught online with hands-on exercises done on remote PCs. . Python Intro Part 1 - Live On-Line, 8:30am - 12:30pm EST, November 10 to 13, 2008 . Python Intro Part 2 - Live On-Line, 8:30am - 12:30pm EST, Novem

One class per file?

2008-09-29 Thread HCB
Hello: The book "Code Complete" recommends that you put only one class in a source file, which seems a bit extreme for me. It seems that many classes are small, so that putting several of them in a file seems reasonable. I noticed that the decimal.py module in the standard library has several clas

Using re to find unicode ranges

2008-09-29 Thread Eric Abrahamsen
Is it possible to use the re module to find runs of characters within a certain Unicode range? I'm writing a Markdown extension to go over text and wrap blocks of consecutive Chinese characters in tags for nice styling in an HTML page. The available hooks appear to be a pre- processor (wh

Re: One class per file?

2008-09-29 Thread Ben Finney
HCB <[EMAIL PROTECTED]> writes: > The book "Code Complete" recommends that you put only one class in a > source file, which seems a bit extreme for me. For Python, that is extreme, and for most applications I've seen it would be counterproductive. Which edition of Code Complete recommends this, a

Re: writing dll in python?

2008-09-29 Thread Tino Wildenhain
nishalrs wrote: Hello All, My main motivation is to build a collection of useful mathematical models (that I have developed over the years) to design ultrasonic sensors. This should be some sort of a library that should be able to be used for desktop/web application development, to run in variet

Re: Web programming in Python.

2008-09-29 Thread Paul Boddie
On 29 Sep, 01:51, Kurda Yon <[EMAIL PROTECTED]> wrote: > 1. On my server (in my directory) I found "cgi-bin" subdirectory. > > 2. In the "cgi-bin" I have created a file "test.py". > > 3. In that file I put: > #!/usr/bin/python2.4 python > print "Hello, World!" > (I have checked, I have "/usr/bin/py

Re: Python OOP question

2008-09-29 Thread Gabriel Genellina
En Thu, 25 Sep 2008 11:45:21 -0300, k3xji <[EMAIL PROTECTED]> escribió: Hi all, I am trying to develop a game-server in python. Design is as following: - ConnectionManager - handling/distributing incoming connections - IOManager - handling IO recv/send operations on sockets. (inheritable) - So

Re: Web programming in Python.

2008-09-29 Thread Steve Holden
Kurda Yon wrote: > 1. On my server (in my directory) I found "cgi-bin" subdirectory. > > 2. In the "cgi-bin" I have created a file "test.py". > > 3. In that file I put: > #!/usr/bin/python2.4 python OK, if /usr/bin/python2.4 really *is* a directory then you will need to make that first line #!/

Re: how to make smtplib.SMTP('localhost') work on window xp

2008-09-29 Thread zxo102
On 9月29日, 下午7时29分, Steve Holden <[EMAIL PROTECTED]> wrote: > zxo102 wrote: > > Hi, > > I am trying to use python module smtplib to send my email out on > > window xp (localhost). > > > import smtplib > > server = smtplib.SMTP('localhost') > > > but I got the error information as follows: > > > Tra

Re: Cannot install pysqlite on Cygwin

2008-09-29 Thread Steve Holden
Tilman Kispersky wrote: > I am trying to install sqlite for use with python on cygwin. I have > installed the sqlite packages from cygwin (that is libsqlite3-devel > and libsqlite3_0). When attempting to easy_install pysqlite I get: > > $ easy_install pysqlite > Searching for pysqlite > Reading h

Re: One class per file?

2008-09-29 Thread Roy Smith
In article <[EMAIL PROTECTED]>, HCB <[EMAIL PROTECTED]> wrote: > Hello: > > The book "Code Complete" recommends that you put only one class in a > source file, which seems a bit extreme for me. It seems that many > classes are small, so that putting several of them in a file seems > reasonable.

os.path.exists() function does not work for http paths

2008-09-29 Thread dudeja . rajat
Hi, I have used os.path.exists() many a times for any file system paths in local system. But this does not seem to work for an Http path. e.g: To check is the Results folder exists at the following path, I do: if not os.path.exists("http://subversion.myCom.com/Testing/Results";): print 'P

Re: closures and dynamic binding

2008-09-29 Thread Paul Boddie
On 29 Sep, 05:56, Terry Reedy <[EMAIL PROTECTED]> wrote: > > As I understand it, partly from postings here years ago... > > Lexical: The namespace scope of 'n' in inner is determined by where > inner is located in the code -- where is is compiled.  This is Python > (and nearly all modern languages)

Re: closures and dynamic binding

2008-09-29 Thread Michele Simionato
On Sep 28, 6:43 am, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > Hello all, > > To me, this is a somewhat unintuitive behavior.  I want to discuss the > parts of it I don't understand. > > >>> f= [ None ]* 10 > >>> for n in range( 10 ): > > ...     f[ n ]= lambda: n > ...>>> f[0]() > 9

Re: Using re to find unicode ranges

2008-09-29 Thread Paul McGuire
On Sep 29, 8:17 am, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > Is it possible to use the re module to find runs of characters within   > a certain Unicode range? > > I'm writing a Markdown extension to go over text and wrap blocks of   > consecutive Chinese characters in tags for   > nice stylin

blocking all threads

2008-09-29 Thread Alexandru Mosoi
how can I block all threads for a specific amount of time? (i need to sleep whole process for testing purposes). i thought of accessing GIL and sleep for some amount of time, but I don't know how to do this and whether GIL is recursive. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is not objects in Python?

2008-09-29 Thread George Sakkis
On Sep 29, 9:02 am, [EMAIL PROTECTED] wrote: > George Sakkis: > > > I don't see the same value in creating a distinction between methods > > and builtin functions unless the latter are truly generic (and even > > then I wouldn't mind having them as methods of the base object class, > > e.g. object

Re: Using re to find unicode ranges

2008-09-29 Thread Mark Tolonen
"Eric Abrahamsen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Is it possible to use the re module to find runs of characters within a certain Unicode range? I'm writing a Markdown extension to go over text and wrap blocks of consecutive Chinese characters in tags for nice

Re: Web programming in Python.

2008-09-29 Thread afrogazer
Not to be a condescending, but there are a lot of manuals out there on how to do this and asking on a forum would really not be the best way to get started. Do some research and some reading and you should be up and running in a short time. You can ask questions on the forum if you have difficultie

Re: What is not objects in Python?

2008-09-29 Thread Mel
George Sakkis wrote: > As Terry Reedy wrote, partly history and partly practicality. There's > no philosophical reason why we write "len(x)" (generic builtin), > "x.append(1)" (method) or "del x[i]" (statement). The latter in > particular is IMHO a design wart; there's no reason for not writing it

Re: What is not objects in Python?

2008-09-29 Thread Marc 'BlackJack' Rintsch
On Mon, 29 Sep 2008 11:14:36 -0400, Mel wrote: > George Sakkis wrote: >> As Terry Reedy wrote, partly history and partly practicality. There's >> no philosophical reason why we write "len(x)" (generic builtin), >> "x.append(1)" (method) or "del x[i]" (statement). The latter in >> particular is IMH

Re: What is not objects in Python?

2008-09-29 Thread bearophileHUGS
George Sakkis: > No difference in principle, just len() happens to be implemented more > often than upper(). That's an important point. In a language that tries to be both practical, readable, and elegant, the things that are done more may deserve some sugar, to avoid code like this in many cases:

Re: What is not objects in Python?

2008-09-29 Thread George Sakkis
On Sep 29, 11:37 am, [EMAIL PROTECTED] wrote: > George Sakkis: > > > No difference in principle, just len() happens to be implemented more > > often than upper(). > > That's an important point. In a language that tries to be both > practical, readable, and elegant, the things that are done more may

Re: Test if list contains another list

2008-09-29 Thread Derek Martin
On Mon, Sep 29, 2008 at 04:12:13AM -0700, [EMAIL PROTECTED] wrote: > Derek Martin: > >Unless you're doing lots and lots of these in your application,< > > I don't agree. That's library code, so it has to be efficient and > flexible, because it's designed to be used in many different > situations

Re: destructor not called

2008-09-29 Thread Marcin201
> Others have already replied to your main question; in short you > shouldn't rely on __del__ being called. Regardless, is there a (good) > reason for having an instance reference to the method ? Without > further information, that seems like a code smell. I have dictionary of fxns to do import/ex

Re: Tkinter: scrollbar - unable to scroll the scrollbar if I click on arrow buttons of scroll bars

2008-09-29 Thread dudeja . rajat
On Sun, Sep 28, 2008 at 4:51 PM, <[EMAIL PROTECTED]> wrote: > > Hi, > > > Im using a tkinter scrollbars for horinzontal and vertical scrolling. Well > the problem is I'm unable to scroll if I click on the arrows buttons of > scrollbars ( with both types of scrollbars) > > > Please suggest if I m m

Re: Python is slow?

2008-09-29 Thread Fly Away
On Sep 29, 3:05 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message > <[EMAIL PROTECTED]>, > > sturlamolden wrote: > > ... and possibility of interfacing with gnuplot ... > > Gnuplot is non-Free software. Yes, it is. Victor. -- http://mail.python.org/mailman/li

Re: Test if list contains another list

2008-09-29 Thread bearophileHUGS
Derek Martin: > code that implements non-obvious algorithms ought to explain what it's > doing in comments, I am sorry, you are right, of course. In my libs/code there are always docstrings and doctests/tests, and most times comments too, like you say. When I post code here I often strip away par

Re: Music knowledge representation

2008-09-29 Thread D'Arcy J.M. Cain
On Sun, 28 Sep 2008 16:37:11 +0200 "Mr.SpOOn" <[EMAIL PROTECTED]> wrote: > Hi, > I'm working on an application to analyse music (melodies, chord sequences > etc.) Sounds interesting. Will this be Open Source? > I need classes to represent different musical entities. I'm using a > class Note to

Generate documentation for a Python developed software

2008-09-29 Thread Alfons Nonell-Canals
Dear all, I have a complex program developed using Python. It contains lot of files and classes. Now I have the lazy task to documentate it. I have some notes about is class but I would like to know if there is something to auto-generate the doucmentation with the program code. I know I will have

Re: Python is slow?

2008-09-29 Thread bearophileHUGS
Lawrence D'Oliveiro: >> Gnuplot is non-Free software. Fly Away: > Yes, it is. From: http://www.gnuplot.info/faq/faq.txt 1.7 Does gnuplot have anything to do with the FSF and the GNU project? [...] Gnuplot is freeware in the sense that you don't have to pay for it. However it is not free

Re: One class per file?

2008-09-29 Thread George Boutsioukis
On Mon, 29 Sep 2008 06:12:35 -0700, HCB wrote: > Hello: > > The book "Code Complete" recommends that you put only one class in a > source file, which seems a bit extreme for me. It seems that many > classes are small, so that putting several of them in a file seems > reasonable. I noticed that th

PYTHON WORKING WITH PERL ??

2008-09-29 Thread Blubaugh, David A.
To All, I was wondering if it was possible to have a situation where a programming project would utilized BOTH python and perl? Such as utilizing python for internet programming and then utilize perl for text processing and systems programming? Is this even feasible??? Thanks, David Blubaug

Re: Generate documentation for a Python developed software

2008-09-29 Thread Chris Rebert
On Mon, Sep 29, 2008 at 9:45 AM, Alfons Nonell-Canals <[EMAIL PROTECTED]> wrote: > Dear all, > I have a complex program developed using Python. It contains lot of > files and classes. > > Now I have the lazy task to documentate it. I have some notes about is > class but I would like to know if ther

Re: One class per file?

2008-09-29 Thread Matimus
> The book "Code Complete" recommends that you put only one class in a > source file, which seems a bit extreme for me. It seems that many > classes are small, so that putting several of them in a file seems > reasonable. I noticed that the decimal.py module in the standard > library has several c

Re: closures and dynamic binding

2008-09-29 Thread Terry Reedy
Paul Boddie wrote: On 29 Sep, 05:56, Terry Reedy <[EMAIL PROTECTED]> wrote: ... Dynamic: The namespace scope of 'n' in inner, how it is looked up, is determined by where inner is called from. This is what you seemed to be suggesting -- look up 'n' based on the scope it is *used* in. ... A so

Re: PYTHON WORKING WITH PERL ??

2008-09-29 Thread D'Arcy J.M. Cain
On Mon, 29 Sep 2008 13:16:14 -0400 "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > I was wondering if it was possible to have a situation where a > programming project would utilized BOTH python and perl? Such as > utilizing python for internet programming and then utilize perl for text > proces

Re: os.path.exists() function does not work for http paths

2008-09-29 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hi, > > I have used os.path.exists() many a times for any file system paths in > local system. But this does not seem to work for an Http path. > > e.g: > > > To check is the Results folder exists at the following path, I do: > > > if not os.path.exists("http://subv

Re: Tkinter: scrollbar - unable to scroll the scrollbar if I click on arrow buttons of scroll bars

2008-09-29 Thread dudeja . rajat
On Mon, Sep 29, 2008 at 5:10 PM, <[EMAIL PROTECTED]> wrote: > > > On Sun, Sep 28, 2008 at 4:51 PM, <[EMAIL PROTECTED]> wrote: > >> >> Hi, >> >> >> Im using a tkinter scrollbars for horinzontal and vertical scrolling. Well >> the problem is I'm unable to scroll if I click on the arrows buttons of >

Re: PYTHON WORKING WITH PERL ??

2008-09-29 Thread Steve Holden
Blubaugh, David A. wrote: > To All, > > > I was wondering if it was possible to have a situation where a > programming project would utilized BOTH python and perl? Such as > utilizing python for internet programming and then utilize perl for text > processing and systems programming? Is this ev

Re: blocking all threads

2008-09-29 Thread sturlamolden
On Sep 29, 4:56 pm, Alexandru Mosoi <[EMAIL PROTECTED]> wrote: > how can I block all threads for a specific amount of time? (i need to > sleep whole process for testing purposes). i thought of accessing GIL > and sleep for some amount of time, but I don't know how to do this and > whether GIL is

Re: One class per file?

2008-09-29 Thread Tim Rowe
2008/9/29 Roy Smith <[EMAIL PROTECTED]>: > That being said, the "one class per file" rule is a means to an end. Although in some languages, the "end" is "code that runs". But Python is not Java... -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is slow?

2008-09-29 Thread Victor Prosolin
[EMAIL PROTECTED] wrote: > Lawrence D'Oliveiro: >>> Gnuplot is non-Free software. > > Fly Away: >> Yes, it is. > > From: > http://www.gnuplot.info/faq/faq.txt > > 1.7 Does gnuplot have anything to do with the FSF and the GNU project? >[...] >Gnuplot is freeware in the sense that you don'

Re: Python is slow?

2008-09-29 Thread r0g
[EMAIL PROTECTED] wrote: > Lawrence D'Oliveiro: >>> Gnuplot is non-Free software. > > Fly Away: >> Yes, it is. > > From: > http://www.gnuplot.info/faq/faq.txt > > 1.7 Does gnuplot have anything to do with the FSF and the GNU project? >[...] >Gnuplot is freeware in the sense that you don'

Re: writing dll in python?

2008-09-29 Thread Terry Reedy
nishalrs wrote: Hello All, My main motivation is to build a collection of useful mathematical models (that I have developed over the years) to design ultrasonic sensors. This should be some sort of a library that should be able to be used for desktop/web application development, to run in variet

Re: One class per file?

2008-09-29 Thread Bruno Desthuilliers
HCB a écrit : Hello: The book "Code Complete" recommends that you put only one class in a source file, That's possibly (don't know...) a good advice for C++, and that's mandatory (at least for 'public' classes) in Java. And that's totally pointless and counterproductive in Python. Also and F

Re: What is not objects in Python?

2008-09-29 Thread Terry Reedy
George Sakkis wrote: Sure, "len" looks better than lambda x:x.__len__(), but the same would be true if there was an "upper" builtin for the following example: s = ['a', 'd', 'B', 'C'] s2 = [u'a', u'd', u'B', u'C'] upper = lambda x: x.upper() sorted(s, key=upper) ['a', 'B', 'C', 'd'] sorted(s

Re: Music knowledge representation

2008-09-29 Thread Mr.SpOOn
On Mon, Sep 29, 2008 at 6:49 PM, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: > On Sun, 28 Sep 2008 16:37:11 +0200 > "Mr.SpOOn" <[EMAIL PROTECTED]> wrote: >> Hi, >> I'm working on an application to analyse music (melodies, chord sequences >> etc.) > > Sounds interesting. Will this be Open Source?

Re: Python style: exceptions vs. sys.exit()

2008-09-29 Thread Bruno Desthuilliers
Lawrence D'Oliveiro a écrit : In message <[EMAIL PROTECTED]>, Ross Ridge wrote: You need either use trial and error to find out, or look at the source. So what's wrong with using the source as documentation? :) Don't know... Ok, having higher-level documentation (the big picture, and quic

Re: closures and dynamic binding

2008-09-29 Thread Aaron "Castironpi" Brady
On Sep 29, 9:14 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 29 Sep, 05:56, Terry Reedy <[EMAIL PROTECTED]> wrote: > > > > > As I understand it, partly from postings here years ago... > > > Lexical: The namespace scope of 'n' in inner is determined by where > > inner is located in the code -- wh

Re: Cannot install pysqlite on Cygwin

2008-09-29 Thread Tilman Kispersky
On Sep 29, 7:49 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Tilman Kispersky wrote: > > I am trying to install sqlite for use with python oncygwin. I have > > installed the sqlite packages fromcygwin(that is libsqlite3-devel > > and libsqlite3_0).  When attempting to easy_install pysqlite I get:

Re: destructor not called

2008-09-29 Thread Bruno Desthuilliers
Marcin201 a écrit : Others have already replied to your main question; in short you shouldn't rely on __del__ being called. Regardless, is there a (good) reason for having an instance reference to the method ? Without further information, that seems like a code smell. I have dictionary of fxns

Re: closures and dynamic binding

2008-09-29 Thread Paul Boddie
On 29 Sep, 19:26, Terry Reedy <[EMAIL PROTECTED]> wrote: > > Please: Python does not have 'lambda functions'. Def statements and > lambda expressions both define instances of the function class. So this > amounts to saying "functions are subject to the same caveats as functions." I myself am awa

Finding subsets for a robust regression

2008-09-29 Thread tkpmep
I have coded a robust (Theil-Sen) regression routine which takes as inputs two lists of numbers, x and y, and returns a robust estimate of the slope and intercept of the best robust straight line fit. In a pre-processing phase, I create two new lists, x1 and y1; x1 has only the unique values in x,

Re: Cannot install pysqlite on Cygwin

2008-09-29 Thread Tilman Kispersky
On Sep 29, 12:37 pm, Tilman Kispersky <[EMAIL PROTECTED]> wrote: > On Sep 29, 7:49 am, Steve Holden <[EMAIL PROTECTED]> wrote: > > > > > Tilman Kispersky wrote: > > > I am trying to install sqlite for use with python oncygwin. I have > > > installed the sqlite packages fromcygwin(that is libsqlite

RE: PYTHON WORKING WITH PERL ??

2008-09-29 Thread Blubaugh, David A.
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 source code (i.e. someone else errors to fix) in Perl. However, I have just found out that there is a way to import the Perl

RE: PYTHON WORKING WITH PERL ??

2008-09-29 Thread Blubaugh, David A.
Thank You Steve!!! -Original Message- From: Steve Holden [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2008 1:38 PM To: python-list@python.org Subject: Re: PYTHON WORKING WITH PERL ?? Blubaugh, David A. wrote: > To All, > > > I was wondering if it was possible to have a

Re: generate random digits with length of 5

2008-09-29 Thread sotirac
On Sep 28, 5:22 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Sep 28, 4:08 pm, Michael Ströder <[EMAIL PROTECTED]> wrote: > > > > > Gary M. Josack wrote: > > > Aaron "Castironpi" Brady wrote: > > >> On Sep 28, 2:59 pm, sotirac <[EMAIL PROTECTED]> wrote: > > > >>> Wondering if the

Re: how to search multiple textfiles ? (Python is slow ?)

2008-09-29 Thread Stef Mientki
Lawrence D'Oliveiro wrote: In message <[EMAIL PROTECTED]>, Stef Mientki wrote: - Pyscripter 110 sec ( PyScripter is the default IDE I use now) - Delphi 20 .. 35 sec - Findstr 4 sec What order did you try try them in? Did you try each one more than once, in different orders? Just to

Re: Finding subsets for a robust regression

2008-09-29 Thread bearophileHUGS
[EMAIL PROTECTED]: > My code follows, and it seems a bit clumsy - is there a cleaner way to do it? The code doesn't look bad. I can suggest few things: - When you have "paragraphs" of code that do something definite then the comment before them can be written without indentation, to denote it reg

Re: One class per file?

2008-09-29 Thread HCB
To answer Ben Finney's questions: The "Put one class in one file" statement is made in "Code Complete 2" page 771. HCB -- http://mail.python.org/mailman/listinfo/python-list

Re: what does "python -i" use as input stream (stdin)?

2008-09-29 Thread Gabriel Genellina
En Fri, 26 Sep 2008 04:29:42 -0300, Almar Klein <[EMAIL PROTECTED]> escribió: I would still like to hear if anyone knows how I can change the input stream that is used when running "python -i", but I would not be surprised if it is impossible... Sure you can. You have to replace the file d

Re: unable to parse the content using the regular expression

2008-09-29 Thread Gabriel Genellina
En Thu, 25 Sep 2008 05:30:41 -0300, <[EMAIL PROTECTED]> escribió: I've the following results from Difflib.Compare() which I want to parse them using the regular expression to find out the the values that have changed. Results:- --- - Analysis Time (Iterations = 1) = 0.0449145s ?

Is Pyperl still active ??

2008-09-29 Thread Blubaugh, David A.
To All, I was wondering if Pyperl is still active?? It appears as though it may very well be no longer active at this time!!! Is this correct?? Thanks, David Blubaugh This e-mail transmission contains information that is confidential and may be privileged. It is intended only for the

Re: Finding subsets for a robust regression

2008-09-29 Thread Gerard flanagan
[EMAIL PROTECTED] wrote: x1 = [] #unique instances of x and y y1 = [] #median(y) for each unique value of x for xx,yy in d.iteritems(): x1.append(xx) l = len(yy) if l == 1: y1.append(yy[0]) else:

Source code for python nativ methods and classes

2008-09-29 Thread Mohed
Hello. I am interrested in seeing the source code for all the nativ builtin methods and clases in python. Is there a webpage that lists them or is this done easier some other way. This is my first post so feel free to creticue, the more you do the faster i learn to post well. Mohed -- http://

Re: Music knowledge representation

2008-09-29 Thread D'Arcy J.M. Cain
On Mon, 29 Sep 2008 20:29:44 +0200 "Mr.SpOOn" <[EMAIL PROTECTED]> wrote: > > Couldn't the note class simply have a list of all the notes and have a > > simple method calculate the actual pitch? > > That's not really how it works. There exists just 12 octave > independent pitch classes. This means

Re: Source code for python nativ methods and classes

2008-09-29 Thread Bard Aase
On Mon, Sep 29, 2008 at 10:51 PM, Mohed <[EMAIL PROTECTED]> wrote: > Hello. > I am interrested in seeing the source code for all the nativ builtin > methods and clases in python. Is there a webpage that lists them or is > this done easier some other way. Check it out from svn? svn co http://svn.p

Re: Finding subsets for a robust regression

2008-09-29 Thread Gerard flanagan
Gerard flanagan wrote: [EMAIL PROTECTED] wrote: x1 = [] #unique instances of x and y y1 = [] #median(y) for each unique value of x for xx,yy in d.iteritems(): x1.append(xx) l = len(yy) if l == 1: y1.append(yy[0])

Converting a strng to an anonymous function

2008-09-29 Thread Nathan Seese
I'm writing a program to sort files with arbitrary python code. The method I'm using for that is to pass sort an anonymous function taken from the arguments. I'm wondering how to change a raw string into an anonyous function. -- http://mail.python.org/mailman/listinfo/python-list

Re: Source code for python nativ methods and classes

2008-09-29 Thread skip
mohed> I am interrested in seeing the source code for all the nativ mohed> builtin methods and clases in python. Is there a webpage that mohed> lists them or is this done easier some other way. Browse the source. You can download it then poke around using your favorite editor: h

Re: Music knowledge representation

2008-09-29 Thread Aaron "Castironpi" Brady
On Sep 29, 3:56 pm, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: > On Mon, 29 Sep 2008 20:29:44 +0200 > > "Mr.SpOOn" <[EMAIL PROTECTED]> wrote: > > > Couldn't the note class simply have a list of all the notes and have a > > > simple method calculate the actual pitch? > > > That's not really how i

Re: Converting a strng to an anonymous function

2008-09-29 Thread bearophileHUGS
On Sep 29, 11:25 pm, Nathan Seese <[EMAIL PROTECTED]> wrote: > I'm writing a program to sort files with arbitrary python code. The > method I'm using for that is to pass sort an anonymous function taken > from the arguments. I'm wondering how to change a raw string into an > anonyous function. Is

Re: Music knowledge representation

2008-09-29 Thread Mr.SpOOn
On Mon, Sep 29, 2008 at 10:56 PM, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: >> I can't estabilish which note is higher, because all the analysis part >> is octave independent. Anyway thanks for the ideas. > > I'm not sure I understand this. You either have to assume that the > first note is the

Re: how to search multiple textfiles ?

2008-09-29 Thread George Sakkis
On Sep 29, 5:16 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message > <[EMAIL PROTECTED]>, George > > Sakkis wrote: > > $ find -name "*py" | xargs egrep "\bword\b" > > Better: > >     find -name '*.py' -exec grep -E "\bword\b" {} \; In what way is this better

Re: Converting a strng to an anonymous function

2008-09-29 Thread Bruno Desthuilliers
Nathan Seese a écrit : I'm writing a program to sort files with arbitrary python code. The method I'm using for that is to pass sort an anonymous function taken from the arguments. I'm wondering how to change a raw string into an anonyous function. Care to give a couple more explanation about

Python arrays and sting formatting options

2008-09-29 Thread Ivan Reborin
Hello everyone, I was wondering if anyone here has a moment of time to help me with 2 things that have been bugging me. 1. Multi dimensional arrays - how do you load them in python For example, if I had: --- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 --- with "i" being the row number,

Re: Converting a strng to an anonymous function

2008-09-29 Thread Nathan Seese
> On Sep 29, 11:25 pm, Nathan Seese <[EMAIL PROTECTED]> wrote: >> I'm writing a program to sort files with arbitrary python code. The >> method I'm using for that is to pass sort an anonymous function taken >> from the arguments. I'm wondering how to change a raw string into an >> anonyous function

Re: [wxpython-users] ANN: wxPython 2.8.9.0

2008-09-29 Thread Robin Dunn
Clay Hobbs wrote: I'm curious, why do you package wxPython for Fedora 6 and 7, but not 8 and 9? It's only because I haven't taken the time to update and retest those build boxes. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! -- http:

Re: Source code for python nativ methods and classes

2008-09-29 Thread Terry Reedy
Bard Aase wrote: On Mon, Sep 29, 2008 at 10:51 PM, Mohed <[EMAIL PROTECTED]> wrote: Hello. I am interrested in seeing the source code for all the nativ builtin methods and clases in python. Is there a webpage that lists them or is this done easier some other way. Check it out from svn? svn co

  1   2   >