Re: Web programming in Python.

2008-09-29 Thread James Matthews
If you are considering using a framework try Django. I enjoy using it! On Sun, Sep 28, 2008 at 6:40 PM, Michael Crute [EMAIL PROTECTED] wrote: On Sun, Sep 28, 2008 at 6:39 PM, Kurda Yon [EMAIL PROTECTED] wrote: I am totaly newbie in the Python's web programming. So, I dont even know the

Re: Web programming in Python.

2008-09-29 Thread Sean DiZazzo
On Sep 28, 4:51 pm, 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/python2.4

Re: Test if list contains another list

2008-09-29 Thread Derek Martin
On Fri, Sep 26, 2008 at 01:39:16PM -0700, [EMAIL PROTECTED] wrote: # building prefix-function m = 0 for i in xrange(1, len_sub): while m 0 and sub[m] != sub[i]: m = table[m - 1] if sub[m] == sub[i]: m += 1 table[i] = m #

Re: What is not objects in Python?

2008-09-29 Thread Carl Banks
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 have heard some criticism about Python, that it is not fully object- oriented. That's

Re: Web programming in Python.

2008-09-29 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Sean DiZazzo wrote: Have you loaded the modpython module in your httpd.conf? Not relevant for CGIs. -- http://mail.python.org/mailman/listinfo/python-list

Cannot install pysqlite on Cygwin

2008-09-29 Thread Tilman Kispersky
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

Re: closures and dynamic binding

2008-09-29 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Aaron Castironpi Brady wrote: [Wikipedia] says: dynamic scoping can be dangerous and almost no modern languages use it, but it sounded like that was what closures use. Closures will use whatever the language says they use. LISP used dynamic binding, but this

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

2008-09-29 Thread Lawrence D'Oliveiro
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? If you telnet/netcat to port 25 on localhost, does anything interesting happen? --

Re: python for *nix system admins

2008-09-29 Thread Lars Stavholm
Thank you all for your input. /Lars Lars Stavholm wrote: Hi All, I'm new to this list and hoping that this is not off-topic. If it is, please point me in the right direction. I seem to recollect a python module or library for *nix sysadmins, but I can't for the life of me find it again.

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

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

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

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 an exploit

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 effects.

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 user.

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? If you

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 interactive input, line 1, in ? File

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 something like: fd =

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 Rebert wrote: On Sun, Sep

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

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 have heard some criticism

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

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 think the

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,

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

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 span class=char/span tags for nice styling in an HTML page. The available hooks appear to be

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, and on

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

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/python2.4

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

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: Traceback (most recent

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

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. I noticed

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

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).  Even

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 f[1]() 9 You may

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 span class=char/span tags for  

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.type()).

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 span

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

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 as

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 IMHO a design

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 That's

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

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 missing some

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

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 part

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

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

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 the

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

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 there is

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

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

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 processing

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

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 scrollbars ( with

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 even

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't have to pay

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't have to pay

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

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

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(s2,

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? Well, yes, I

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 quick

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 -- where is is

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 aware of

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

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 libsqlite3-devel and

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 there is a better way to generate

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

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

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

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 that there

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

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:

  1   2   3   >