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

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

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

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

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

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

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

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

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

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

<    1   2