Python script for tracert

2008-09-29 Thread cindy jones
Hello.. I'm trying to do a scripting for tracert in windows using python... I'm using popen(), but it displays only after the tracert is completed. i want the results to be displayed for every route. can anyone help me in this.. Thank You -- http://mail.python.org/mailman/listinfo/python-list

Re: PID management with popen and spawn

2008-09-29 Thread Gabriel Genellina
En Thu, 25 Sep 2008 12:36:00 -0300, EEK <[EMAIL PROTECTED]> escribió: My goal is to start and stop separate Linux processes from a python program by specific PID. The output of these processes needs to have their stderr and stdout piped to a particular file, respectively. I've been able to m

Re: What is not objects in Python?

2008-09-29 Thread Steven D'Aprano
On Mon, 29 Sep 2008 21:03:07 -0700, namekuseijin wrote: >> Why isn't len implemented as a str.len and list.len method instead of a >> len(list) function? > > Because postfix notation sucks. The natural way of spelling is > adjective+noun and verb+predicate. "Natural"? You mean phrases like "he

Re: Python arrays and sting formatting options

2008-09-29 Thread Marc 'BlackJack' Rintsch
On Tue, 30 Sep 2008 03:56:03 +0200, Ivan Reborin wrote: > a = 2.01 > b = 123456.789 > c = 1234.0001 > d = 98765.4321 > # same as above except for d > > print (3 * '%12.3f') % (a, b, c) > #this works beautifully > > How to add d at the end but with a different format now, since I've > "used"

Re: python & sms

2008-09-29 Thread sui
On Sep 30, 10:10 am, "James Mills" <[EMAIL PROTECTED]> wrote: > sui, > > I am sure you'll find many web services > that you can use to send SMS'. Your > problem would then become one of > learning how to communicate and access > web services in Python. Start with: > * urllib and urllib2 > * xmlrp

Re: python & sms

2008-09-29 Thread James Mills
sui, I am sure you'll find many web services that you can use to send SMS'. Your problem would then become one of learning how to communicate and access web services in Python. Start with: * urllib and urllib2 * xmlrpc There are others... cheers James On Tue, Sep 30, 2008 at 1:47 PM, sui <[EM

Re: Newbie question...

2008-09-29 Thread Tim Leslie
On Tue, Sep 30, 2008 at 12:04 PM, Ken D'Ambrosio <[EMAIL PROTECTED]> wrote: > First, apologies for such a newbie question; if there's a better forum (I've > poked around, some) feel free to point it out to me. Anyway, a mere 25-odd > years after first hearing about OOP, I've finally decided to go

Re: python & sms

2008-09-29 Thread Sean DiZazzo
On Sep 29, 8:47 pm, sui <[EMAIL PROTECTED]> wrote: > Hii > i want a script to send sms to any mobile. > can u help me ?? > > Thanks in advance.. Must...be...smarter...than...cell...phone... -- http://mail.python.org/mailman/listinfo/python-list

Re: PYTHON WORKING WITH PERL ??

2008-09-29 Thread Sean DiZazzo
On Sep 29, 12:44 pm, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > Sir, > > You are absolutely correct.  I was praying to G_d I did not have to > slaughter my project's source code in this manner.  However, like life > itself, I was given legacy source code (i.e. someone else errors to fix) > i

Re: What is not objects in Python?

2008-09-29 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Terry Reedy <[EMAIL PROTECTED]> wrote: > It should be both, just as + is addition for numbers and concatenation > for sequences. Actually, the math folks would argue that using + for concatenation is wrong, since by normal math rules, + denotes a commutative op

Re: rlcompleter and wxPython, problems ...

2008-09-29 Thread Gabriel Genellina
En Sun, 28 Sep 2008 19:25:30 -0300, Stef Mientki <[EMAIL PROTECTED]> escribió: I'm trying to implement autocompletion into my editor. But I find some weird behavior, or at least I don't have the faintest idea why this behavior occures, and even more important how to solve it In the example b

Re: Finding subsets for a robust regression

2008-09-29 Thread Gabriel Genellina
En Mon, 29 Sep 2008 17:04:48 -0300, <[EMAIL PROTECTED]> escribió: result_x = uniques_x.keys() result_y = map(median, uniques_x.itervalues()) I think it works because keys and values are given in the same order, but in real code I tend to avoid using such subtle things. Because if you tr

Re: What is not objects in Python?

2008-09-29 Thread namekuseijin
On 28 set, 15:29, process <[EMAIL PROTECTED]> wrote: > I have heard some criticism about Python, that it is not fully object- > oriented. So what? > Why isn't len implemented as a str.len and list.len method instead of > a len(list) function? Because postfix notation sucks. The natural way of s

Re: What is not objects in Python?

2008-09-29 Thread Terry Reedy
Steven D'Aprano wrote: On Mon, 29 Sep 2008 05:41:02 -0700, George Sakkis wrote: For example I would be much less opposed to len() being defined as, say, |x| if "|...|" was a valid operator. Arghh! No!!! |x| should be abs(x), not len(x). Just ask mathematicians and physicists. It should be

Re: PYTHON WORKING WITH PERL ??

2008-09-29 Thread namekuseijin
On 29 set, 14:16, "Blubaugh, David A." <[EMAIL PROTECTED]> 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

python & sms

2008-09-29 Thread sui
Hii i want a script to send sms to any mobile. can u help me ?? Thanks in advance.. -- http://mail.python.org/mailman/listinfo/python-list

Newbie question...

2008-09-29 Thread Ken D'Ambrosio
First, apologies for such a newbie question; if there's a better forum (I've poked around, some) feel free to point it out to me. Anyway, a mere 25-odd years after first hearing about OOP, I've finally decided to go to it, by way of Python. But this puzzles me: import commands free = command

Re: Using re to find unicode ranges

2008-09-29 Thread Eric Abrahamsen
On Sep 29, 11:03 pm, "Mark Tolonen" <[EMAIL PROTECTED]> wrote: > "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 o

ANN: wxPython 2.8.9.1

2008-09-29 Thread Robin Dunn
Announcing -- The 2.8.9.1 release of wxPython is now available for download at http://wxpython.org/download.php. This release adds a quick fix for a compatibility problem with Python 2.4. Source code is available, as well as binaries for Python 2.3, 2.4 and 2.5, for Windows and Mac, as

Re: Configuring pyc directory

2008-09-29 Thread Gabriel Genellina
En Sat, 27 Sep 2008 19:06:25 -0300, Robert Moore <[EMAIL PROTECTED]> escribió: Is there a way to configure python to read/write compiled pyc files for modules in a directory other than the directory containing the original py files? If you use the py_compile module, you can specify three

Re: Comparing float and decimal

2008-09-29 Thread Gabriel Genellina
En Thu, 25 Sep 2008 08:02:49 -0300, Mark Dickinson <[EMAIL PROTECTED]> escribió: On Sep 23, 1:58 pm, Robert Lehmann <[EMAIL PROTECTED]> wrote: I don't see why transitivity should apply to Python objects in general. Hmmm. Lack of transitivity does produce some, um, interesting results when pl

Re: Python arrays and sting formatting options

2008-09-29 Thread Chris Rebert
On Mon, Sep 29, 2008 at 6:56 PM, Ivan Reborin <[EMAIL PROTECTED]> wrote: > On Mon, 29 Sep 2008 17:59:40 -0700 (PDT), [EMAIL PROTECTED] > wrote: > > Hello bearophile, thank you for replying. > >>The Python genie grants you that wish. You were almost right: > print (3 * '%12.3f') % (a, b, c) >>

Re: Time.sleep(0.0125) not available within Linux

2008-09-29 Thread Gabriel Genellina
En Sat, 27 Sep 2008 01:46:45 -0300, Lawrence D'Oliveiro <[EMAIL PROTECTED]> escribió: In message <[EMAIL PROTECTED]>, Grant Edwards wrote: On 2008-09-26, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: In message <[EMAIL PROTECTED]>, Grant Edwards wrote: Never assume somebody reading the ar

Re: Python arrays and sting formatting options

2008-09-29 Thread Ivan Reborin
On Mon, 29 Sep 2008 17:59:40 -0700 (PDT), [EMAIL PROTECTED] wrote: Hello bearophile, thank you for replying. >The Python genie grants you that wish. You were almost right: print (3 * '%12.3f') % (a, b, c) > 2.000 123456.7891234.000 print 3 * '%12.3f' % (a, b, c) > 2.000

Re: pyXLWriter warnings

2008-09-29 Thread John Machin
On Sep 30, 9:09 am, Robert Singer <[EMAIL PROTECTED]> wrote: > Platform: winXP, excel 2003 > Python 2.5.2 > XLWriter 0.4a3 (http://sourceforge.net/projects/pyxlwriter/) > > Is anyone here using this very nice package, for writing excel files? > I'm using it on python 2.5.2. (although it is made for

Re: Python is slow?

2008-09-29 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, r0g wrote: > You can only distribute modifications to gnuplot itself as > patches, but you can distribute it freely ... This must be some new definition of "freely" of which I'm unaware. -- http://mail.python.org/mailman/listinfo/python-list

Re: writing dll in python?

2008-09-29 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, nishalrs wrote: > Should I write all the functions as simple python scripts? Or is there > some facility for creating a .dll like library, that could be more > suitable for what in intend to develop? Start with Python. -- http://mail.python.org/mailman/listinfo/pyt

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

2008-09-29 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > (1) It's not always available. But we're talking about Python libraries here, right? > (2) Even when the source is available, it is sometimes a legal trap to > read it with respect to patents and copyright. That's not how patents work. --

Re: adding in-place operator to Python

2008-09-29 Thread Gabriel Genellina
En Thu, 25 Sep 2008 17:04:59 -0300, Arash Arfaee <[EMAIL PROTECTED]> escribió: Thank you very much Gerhard and Terry. I am trying to add undefined state to some Boolean operator. Here is what I tried to do and It is not working: class _3ph: def __init__(self): self.value = 0

Re: Python arrays and sting formatting options

2008-09-29 Thread bearophileHUGS
Ivan Reborin: > Is there a way to just do something like this (not normal syntax, just > my wishful thinking): > print 3*'%12.3f' %a,b,c > (meaning - use this format for the next 3 real numbers that come > along) The Python genie grants you that wish. You were almost right: >>> a = 2.01 >>> b

Re: Python arrays and sting formatting options

2008-09-29 Thread Ivan Reborin
On Mon, 29 Sep 2008 16:08:28 -0700 (PDT), Mensanator <[EMAIL PROTECTED]> wrote: >> 2. I've read the help on the next one but I just find it difficult >> understanding it. >> I have; >> a=2.01 >> b=123456.789 >> c=1234.0001 >> Hello Mensanator, thank you for answering in such a short time. <

Re: What is not objects in Python?

2008-09-29 Thread Steven D'Aprano
On Mon, 29 Sep 2008 05:41:02 -0700, George Sakkis wrote: > For example I would be much less > opposed to len() being defined as, say, |x| if "|...|" was a valid > operator. Arghh! No!!! |x| should be abs(x), not len(x). Just ask mathematicians and physicists. *wink* Actually there's a serious

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

2008-09-29 Thread Steven D'Aprano
On Mon, 29 Sep 2008 18:27:22 +0200, Bruno Desthuilliers wrote: > 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? :)

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 a

Re: One class per file?

2008-09-29 Thread Ben Finney
HCB <[EMAIL PROTECTED]> writes: > The "Put one class in one file" statement is made in "Code Complete > 2" page 771. Thanks. I don't have the second edition; I wonder what the context of that advice is? Perhaps he's speaking only of C++ or Java. Certainly I'd expect the author to reconsider that

pyXLWriter warnings

2008-09-29 Thread Robert Singer
Platform: winXP, excel 2003 Python 2.5.2 XLWriter 0.4a3 (http://sourceforge.net/projects/pyxlwriter/) Is anyone here using this very nice package, for writing excel files? I'm using it on python 2.5.2. (although it is made for older version of python) and cannot find a way to get rid of this error

Re: Python arrays and sting formatting options

2008-09-29 Thread Mensanator
On Sep 29, 5:04 pm, Ivan Reborin <[EMAIL PROTECTED]> wrote: > 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1   2   >