Re: NumPy 1.0b4 now available

2006-08-30 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Robert Kern wrote: >>[EMAIL PROTECTED] wrote: [...] The full C-API of Numeric is supported as is the C-API of Numarray. More information is available at http://numpy.scipy.org >>> >>>Like the statement >>> >>>"There is a module called convertcode.py in N

Re: Coding style and else statements

2006-08-30 Thread Ben Finney
"Carl Banks" <[EMAIL PROTECTED]> writes: > However, I have rare cases where I do choose to use the else > (ususally in the midst of a complicated piece of logic, where it's > be more distracting than concise). In that case, I'd do something > like this: > > def foo(thing): > if thing: >

Re: Allowing ref counting to close file items bad style?

2006-08-30 Thread [EMAIL PROTECTED]
Paul Rubin wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > I disagree, somewhat. No, you shouldn't count on the "ref count" per > > se going to 0. And you shouldn't count on the file object being GC'd > > _immediately_ after the last reference is destroyed. You should be able > > to

Re: What do you want in a new web framework?

2006-08-30 Thread BJörn Lindqvist
> > > I have already suggested to the BDFL that he can remedy this situation > > > in Py3k: all he has to do, of course, is to add a LOT more keywords. > > > > Here is another remedy: he adds one of the frameworks to the standard > > library :) > > That didn't help Tk maintain a monopoly on Python

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-30 Thread Joachim Durchholz
Tim Peters schrieb: > > O() notation isn't being used I was replying to Gabriel's post: > In fact it's the other way - losing a factor of 2 is irrelevant, > O(2N)=O(N). The logN factor is crucial here. Regards, Jo -- http://mail.python.org/mailman/listinfo/python-list

psycopg2 features

2006-08-30 Thread Maxim Sloyko
Hello, clp and all people reading it! Recently I was porting my (small) app from psycopg to psycopg2 (they got me with this "2"). I read, that psycopg2 supports all features of psycopg and plus many more, however, when I started to port, I discovered, that psycopg2 lacks serialized connections and

Re: The lib email parse problem...

2006-08-30 Thread John Machin
On 30/08/2006 4:44 PM, 叮叮当当 wrote: > yes, the special is i must choose exactly one section to destruct, > instead of processing all subparts. So have you tried to use the example I posted yesterday? Do you still have any problems? Note: it is generally a good idea to post a message when you have

Re: psycopg2 features

2006-08-30 Thread Simon Forman
Maxim Sloyko wrote: > Hello, clp and all people reading it! > Recently I was porting my (small) app from psycopg to psycopg2 (they > got me with this "2"). > I read, that psycopg2 supports all features of psycopg and plus many > more, however, when I started to port, I discovered, that psycopg2 >

Re: What do you want in a new web framework?

2006-08-30 Thread Ben Finney
"BJörn Lindqvist" <[EMAIL PROTECTED]> writes: > In fact, it almost seems like[...] There exist better third party > modules and packages of most functionality in the standard > library. The only examples I can think of that seem to have a > "monopoly" is subprocess, decimal, thread and pickle. Are

Re: What do you want in a new web framework?

2006-08-30 Thread Maxim Sloyko
Laurent Pointal wrote: > > Look at http://wiki.python.org/moin/WebFrameworks > > Do you *really* need to develop a *new* framework (maybe a scholl > exercise - it that case, KISS)? Isn't the main reason why there are so many of them is that all of them suck badly? -- http://mail.python.org/mailm

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-30 Thread Duncan Booth
Tim Peters wrote: > [/T] >>> OTOH, current versions of Python (and Perl) > > [/F] >> just curious, but all this use of (& Perl) mean that the Perl folks have >> implemented timsort ? > > A remarkable case of independent harmonic convergence: > > http://mail.python.org/pipermail/python-dev/2

Re: Allowing ref counting to close file items bad style?

2006-08-30 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Sure. But most Java GCs are pretty reasonable and for typical code > will run periodically (what I call the not-horribly-distant future). If your system allows max 100 files open and you're using 98 of them, then "horribly distant future" can be a

Re: Coding style and else statements

2006-08-30 Thread Tal Einat
Sybren Stuvel wrote: > Tal Einat enlightened us with: > > Actually, the common work-around for this is: > > > > (thing and [thing+1] or [-1])[0] > > > > This works since non-empty lists are always considered true in > > conditional context. This is more generic, and IMO more readable. > > I think

Re: What do you want in a new web framework?

2006-08-30 Thread Steve Holden
Maxim Sloyko wrote: > Laurent Pointal wrote: > >>Look at http://wiki.python.org/moin/WebFrameworks >> >>Do you *really* need to develop a *new* framework (maybe a scholl >>exercise - it that case, KISS)? > > > Isn't the main reason why there are so many of them is that all of them > suck badly?

Re: What do you want in a new web framework?

2006-08-30 Thread Georg Brandl
Maxim Sloyko wrote: > Laurent Pointal wrote: >> >> Look at http://wiki.python.org/moin/WebFrameworks >> >> Do you *really* need to develop a *new* framework (maybe a scholl >> exercise - it that case, KISS)? > > Isn't the main reason why there are so many of them is that all of them > suck badly?

Re: TNEF decoder

2006-08-30 Thread Hendrik van Rooyen
"Simon Forman" <[EMAIL PROTECTED]> wrote: 8<- | A place I once worked at had a project that included some TNEF | handling. There was one developer assigned fulltime to it. He was the | one who sat at his desk hurling curses at his workstation at the top of | his lun

Re: Naming conventions

2006-08-30 Thread Bruno Desthuilliers
Ben Finney wrote: > "glenn" <[EMAIL PROTECTED]> writes: > >> Bruno Desthuilliers wrote: >>> It might be better to use newstyle classes if you can. Also, the >>> convention is to use CamelCase for classes names (unless you have >>> a strong reason to do otherwise). > > Note that this style is more

Re: refering to base classes

2006-08-30 Thread Bruno Desthuilliers
glenn wrote: > Bruno Desthuilliers wrote: > (snip) >> >> Here you could use a class attribute to provide a default: >> >> class Creature(object): >> noise = "" >> >> def voice(self): >> return "voice:" + self.noise >> >> >> class Dog(Creature): >> noise="bark" >> >> def voice(self): >>

Re: Variables in nested functions

2006-08-30 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > Is it possible to change the value of a variable in the outer function > if you are in a nested inner function? Depends on what you mean by "changing the value". If you mean mutating a mutable object, yes, it's possible. If you mean rebinding the name to a different obje

Re: Variables in nested functions

2006-08-30 Thread Bryan Olson
Ben Cartwright wrote: > The typical kludge is to wrap the variable in the outer function inside > a mutable object, then pass it into the inner using a default argument: > > def outer(): > a = "outer" > def inner(wrapa=[a]): > print wrapa[0] > wrapa[0] = "inner" > retu

Re: TNEF decoder

2006-08-30 Thread Steve Holden
Hendrik van Rooyen wrote: > "Simon Forman" <[EMAIL PROTECTED]> wrote: > > 8<- > > > | A place I once worked at had a project that included some TNEF > | handling. There was one developer assigned fulltime to it. He was the > | one who sat at his desk hurling curses

how can i change the text delimiter

2006-08-30 Thread sonald
Hi, Can anybody tell me how to change the text delimiter in FastCSV Parser ? By default the text delimiter is double quotes(") I want to change it to anything else... say a pipe (|).. can anyone please tell me how do i go about it? -- http://mail.python.org/mailman/listinfo/python-list

Re: how can i change the text delimiter

2006-08-30 Thread Amit Khemka
sonald <[EMAIL PROTECTED]> wrote: > Hi, > Can anybody tell me how to change the text delimiter in FastCSV Parser > ? > By default the text delimiter is double quotes(") > I want to change it to anything else... say a pipe (|).. > can anyone please tell me how do i go about it? You can use the pars

Re: newbe question about removing items from one file to another file

2006-08-30 Thread Anthra Norell
Dexter, Here's a function that screens out all instrument blocks and puts them into a dictionary keyed on the instrument number: def get_instruments (file_name): INSIDE = 1 OUTSIDE = 0 f = file (file_name, 'ra') state = OUTSIDE inst

Re: how can i change the text delimiter

2006-08-30 Thread Amit Khemka
On 8/30/06, Amit Khemka <[EMAIL PROTECTED]> wrote: > sonald <[EMAIL PROTECTED]> wrote: > > Hi, > > Can anybody tell me how to change the text delimiter in FastCSV Parser > > ? > > By default the text delimiter is double quotes(") > > I want to change it to anything else... say a pipe (|).. Btw, I

Re: how can i change the text delimiter

2006-08-30 Thread sonald
Hi Amit, Thanks for a quick response... E.g record is: "askin"em" This entire text is extracted as one string but since the qualifier is double quotes("), therefore fastcsv parser is unable to parse it. If we can change the text qualifier to pipe(|), then the string will look like this: |askin"em

Re: ntp in python

2006-08-30 Thread Jeremy Sanders
Janto Dreijer wrote: > Maybe I'd be better off writing my own implementation that synchronises > the two pc clocks. Any hints? :-) I think you might read up on how ntp synchronises clocks (their website is very thorough), and use their algorithm. It is supposed to be very robust algorithm. I saw

Re: how can i change the text delimiter

2006-08-30 Thread Fredrik Lundh
"sonald" wrote: > Thanks for a quick response... > E.g record is: "askin"em" that's usually stored as "askin""em" in a CSV file, and the csv module has no problem handling that: >>> import csv, StringIO >>> source = StringIO.StringIO('"askin""em"\n') >>> list(csv.reader(source))

Re: how can i change the text delimiter

2006-08-30 Thread skip
sonald> Can anybody tell me how to change the text delimiter in FastCSV sonald> Parser? By default the text delimiter is double quotes(") I sonald> want to change it to anything else... say a pipe (|).. can sonald> anyone please tell me how do i go about it? I'm not familiar wit

Re: Python web service ...

2006-08-30 Thread NicolasG
You mean to use only python HTTP socket library ? I never had use sockets before, it has a big learning curve ? Gabriel Genellina wrote: > At Monday 28/8/2006 20:45, Nicolas G wrote: > > >If I want to run my program as a web service I need to setup a > >webserver , am I right ? > >Whars that differ

Odd unicode() behavior

2006-08-30 Thread maport
The behavior of the unicode built-in function when given a unicode string seems a little odd to me: >>> unicode(u"abc") u'abc' >>> unicode(u"abc", "ascii") Traceback (most recent call last): File "", line 1, in ? TypeError: decoding Unicode is not supported I don't see why providing the encoding

Re: What do you want in a new web framework?

2006-08-30 Thread Kay Schluehr
Cliff Wells wrote: > My single wishlist item (which will probably never happen) is actually > the *removal* of a single "feature": the distinction between statements > and expressions. Forget list comprehensions, ternary operators, etc. > You get them with no additional syntax in expression-based

Re: refering to base classes

2006-08-30 Thread glenn
> > Shouldn't that be > > beagle = animal.dog() > > to create an instance? > > We've all done it ... lol - actually Im confused about this - there seem to be cases where instantiaing with: instance=module.classname() gives me an error, but instance=module.classname doesnt - so I got into that habit

Re: Python web service ...

2006-08-30 Thread Steve Holden
NicolasG wrote (top-posting, which is very naughty ...): >>At Monday 28/8/2006 20:45, Nicolas G wrote: >> >> >>>If I want to run my program as a web service I need to setup a >>>webserver , am I right ? >>>Whars that difference ? can a webservice be run without a webserver ? >> >>Well, a webservice

Re: refering to base classes

2006-08-30 Thread glenn
thanks - interesting essay/article - a lot in their I've never really considered - though its only recently ive started playing with multiple inheritance in any context - thanks for that Bruno Desthuilliers wrote: > glenn wrote: > > Bruno Desthuilliers wrote: > > > (snip) > >> > >> Here you could

Re: Odd unicode() behavior

2006-08-30 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > The behavior of the unicode built-in function when given a unicode > string seems a little odd to me: > unicode(u"abc") > u'abc' > unicode(u"abc", "ascii") > Traceback (most recent call last): > File "", line 1, in ? > TypeError: decoding Unicode is not support

Re: What do you want in a new web framework?

2006-08-30 Thread Felipe Almeida Lessa
2006/8/30, Ben Finney <[EMAIL PROTECTED]>: > re > struct > unicodedata > decimal > random > logging > Queue > urlparse > email operator cStringIO math cmath sets (merged to the language) itertools os + stat time tempfile glob Not that I use them all the time, b

Re: refering to base classes

2006-08-30 Thread Chaz Ginger
glenn wrote: >> Shouldn't that be >> >> beagle = animal.dog() >> >> to create an instance? >> >> We've all done it ... > lol - actually Im confused about this - there seem to be cases where > instantiaing with: > instance=module.classname() > gives me an error, but > instance=module.classname > doe

Re: refering to base classes

2006-08-30 Thread Bruno Desthuilliers
glenn wrote: >> Shouldn't that be >> >> beagle = animal.dog() >> >> to create an instance? >> >> We've all done it ... > lol - actually Im confused about this - there seem to be cases where > instantiaing with: > instance=module.classname() > gives me an error, but > instance=module.classname > doe

Re: refering to base classes

2006-08-30 Thread Bruno Desthuilliers
glenn wrote: >>> Bruno Desthuilliers wrote: >> >> http://www.python.org/download/releases/2.2.3/descrintro/#mro > thanks - interesting essay/article - a lot in their I've never really > considered - though its only recently ive started playing with multiple > inheritance in any context - thanks f

models & editors in PyQt4

2006-08-30 Thread Skink
Hi, I created simple property classes with editing option, but since i'm not too much experienced in PyQt4 i'd like to ask if i handle ColorProperty changing right. Any other Property has its own editor and their control flow is imho ok. Hovewer i'm not sure about ColorProperty. What i do is:

Re: how can i change the text delimiter

2006-08-30 Thread sonald
Hi , thanks for the reply... fast csv is the the csv module for Python... and actually the string cannot be modified because it is received from a third party and we are not supposed to modify the data in any way.. for details on the fast CSV module please visit www.object-craft.com.au/projects

where or filter on list

2006-08-30 Thread [EMAIL PROTECTED]
Hi, Can anybody tell me how to to find the nearest value to zero in a list ? To do that, i'm using list comprenhension : >>> foo = [-5,-1,2,3] # nearest value to zero ? >>> [value for value in foo if math.fabs(value) == min([int(math.fabs(x)) for x >>> in foo])] [-1] Something simpler ? How to

Re: how can i change the text delimiter

2006-08-30 Thread Fredrik Lundh
"sonald" wrote: > fast csv is the the csv module for Python... no, it's not. the csv module for Python is called "csv". > and actually the string cannot be modified because > it is received from a third party and we are not supposed to modify the > data in any way.. that doesn't prevent you fr

Re: refering to base classes

2006-08-30 Thread Georg Brandl
Chaz Ginger wrote: > glenn wrote: >>> Shouldn't that be >>> >>> beagle = animal.dog() >>> >>> to create an instance? >>> >>> We've all done it ... >> lol - actually Im confused about this - there seem to be cases where >> instantiaing with: >> instance=module.classname() >> gives me an error, but >

Re: Naming conventions (was: Re: refering to base classes)

2006-08-30 Thread Neil Cerutti
On 2006-08-30, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Wed, 30 Aug 2006 14:22:16 +1000, Ben Finney <[EMAIL PROTECTED]> wrote: >>"glenn" <[EMAIL PROTECTED]> writes: >> >>> Bruno Desthuilliers wrote: >>> > It might be better to use newstyle classes if you can. Also, the >>> > convention i

Re: how can i change the text delimiter

2006-08-30 Thread skip
sonald> fast csv is the the csv module for Python... and actually the sonald> string cannot be modified because it is received from a third sonald> party and we are not supposed to modify the data in any way.. sonald> for details on the fast CSV module please visit sonald> w

Re: refering to base classes

2006-08-30 Thread Chaz Ginger
Georg Brandl wrote: > Chaz Ginger wrote: >> glenn wrote: Shouldn't that be beagle = animal.dog() to create an instance? We've all done it ... >>> lol - actually Im confused about this - there seem to be cases where >>> instantiaing with: >>> instance=module.classn

Re: where or filter on list

2006-08-30 Thread skip
foo = [-5,-1,2,3] # nearest value to zero ? [value for value in foo if math.fabs(value) == min([int(math.fabs(x)) for x in foo])] charles> [-1] charles> Something simpler ? Well, you can just use the abs() builtin instead of math.fabs. Also, just compute the min/abs on

Re: Python for Windows

2006-08-30 Thread Larry Bates
mistral wrote: > I need compile code written in Python. I use Windows 98SE. Should I > download Python for Windows installer? > http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi > Will the msi installer modify registry or other system files? Does it > possible install Python not touching regi

Re: Naming conventions

2006-08-30 Thread Chaz Ginger
Neil Cerutti wrote: > On 2006-08-30, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> On Wed, 30 Aug 2006 14:22:16 +1000, Ben Finney <[EMAIL PROTECTED]> wrote: >>> "glenn" <[EMAIL PROTECTED]> writes: >>> Bruno Desthuilliers wrote: > It might be better to use newstyle classes if you can. A

From xml data to python code to run

2006-08-30 Thread ralfbrand50
Hello, I've got the following question: Is it possible to run data that's from an xml file as python code, by this I mean the following. In a xml file there's the following data Now I want to extract the self.wTree.signal_autoconnect(dic)* from the xml file and make it possible that Python ru

basename with extensions

2006-08-30 Thread Peter Saffrey
I'd like to resurrect this subject: http://groups.google.com/group/comp.lang.python/browse_frm/thread/11146344b03e72b6/6b2a3b0c0e902114?lnk=gst&q=basename&rnum=2#6b2a3b0c0e902114 If I have a path like this: mypath = /some/long/path/file.xml and I want "file" I currently have to do: os.path.bas

Re: Naming conventions

2006-08-30 Thread Neil Cerutti
On 2006-08-30, Chaz Ginger <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> The first time I saw StudlyCaps I thought it was the ugliest >> thing I'd ever seen. Now I use it a lot. I still have trouble >> with GVR's preference for HTTPServer over HttpServer. The >> latter is, to me, easier to r

Re: basename with extensions

2006-08-30 Thread Tal Einat
Peter Saffrey wrote: > I'd like to resurrect this subject: > > http://groups.google.com/group/comp.lang.python/browse_frm/thread/11146344b03e72b6/6b2a3b0c0e902114?lnk=gst&q=basename&rnum=2#6b2a3b0c0e902114 > > [snip] > > Or have I missed something? > The Python developers are working on a new path

Re: where or filter on list

2006-08-30 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > Another way might be to sort by absolute value: > > intermed = [(abs(v), v) for v in foo] > intermed.sort() > intermed[0][1] It is slightly simpler if you use sorted (assuming a recent enough Python): intermed = sorted(foo, key=abs) print intermed[

Re: where or filter on list

2006-08-30 Thread Philipp Pagel
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Can anybody tell me how to to find the nearest value to zero in a > list? > >>> foo = [-5,-1,2,3] # nearest value to zero ? > >>> [value for value in foo if math.fabs(value) == min([int(math.fabs(x)) for > >>> x in foo])] > [-1] > Something simpler

Re: where or filter on list

2006-08-30 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hi, > > Can anybody tell me how to to find the nearest value to zero in a list > ? > > To do that, i'm using list comprenhension : > foo = [-5,-1,2,3] # nearest value to zero ? [value for value in foo if math.fabs(value) == min([int(math.fabs(x)) for x

xml.sax.writer

2006-08-30 Thread Dominic Fox
Hi, xml.sax.writer doesn't appear in the global module documentation, and googling for it doesn't tell you all that much either. Is it actually in the standard libraries, or is it an interloper from something else (the libxml bindings, say) that just happens to have taken up residence in the xml.s

Re: where or filter on list

2006-08-30 Thread [EMAIL PROTECTED]
Thanks all ! > Question: what if two values are equidistant? >>> def closest(foo,v): ... intermed = [(abs(v), v) for v in foo] ... intermed.sort() ... return [x[1] for x in intermed if x[0] == intermed[0][0]] ... >>> print closest([-20,-10,10,15],0) [-10, 10] Works fine ! (now with

Re: where or filter on list

2006-08-30 Thread skip
>> Another way might be to sort by absolute value: >> >> intermed = [(abs(v), v) for v in foo] >> intermed.sort() >> intermed[0][1] Duncan> It is slightly simpler if you use sorted (assuming a recent Duncan> enough Python): Duncan> intermed = sorted(foo, key=

dictionary with object's method as thier items

2006-08-30 Thread noro
Is it possible to do the following: for a certain class: class C: def func1(self): pass def func2(self): pass def func4(self): pass obj=C() by some way create a dictionary that look somthing like t

Re: where or filter on list

2006-08-30 Thread Neil Cerutti
On 2006-08-30, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > Can anybody tell me how to to find the nearest value to zero in a list > ? > > To do that, i'm using list comprenhension : > foo = [-5,-1,2,3] # nearest value to zero ? [value for value in foo if math.fabs(value) == min

Re: How ahead are you guys in the (Python) real world?

2006-08-30 Thread John Salerno
Ray wrote: > However I wonder, how fast are you guys moving from version to version > at work? Interesting question. Just as a curious follow-up (not being someone who works in the programming world), why does it take so long to move to the latest version, especially when there aren't (I don't

Re: From xml data to python code to run

2006-08-30 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Is it possible to run data that's from an xml file as python code, by > this I mean the following. > > In a xml file there's the following data > > > > Now I want to extract the self.wTree.signal_autoconnect(dic)* from the > xml file and make it possible that Python run

Re: where or filter on list

2006-08-30 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > > >> Another way might be to sort by absolute value: > >> > >> intermed = [(abs(v), v) for v in foo] > >> intermed.sort() > >> intermed[0][1] > > Duncan> It is slightly simpler if you use sorted (assuming a recent > Duncan> enough Python):

Re: How ahead are you guys in the (Python) real world?

2006-08-30 Thread Fredrik Lundh
John Salerno wrote: > when there aren't (I don't think) any changes that would break existing code, in practice, in a large enough system, there's always something. (external libraries are a common problem, especially if you have to rebuild them, or update them to a new version to work around s

RE: How ahead are you guys in the (Python) real world?

2006-08-30 Thread Tim Golden
[John Salerno] | Interesting question. Just as a curious follow-up (not being | someone who works in the programming world), why does it take | so long to move to the latest version, especially when there | aren't (I don't think) any changes that would break existing | code, such as moving to

Re: How ahead are you guys in the (Python) real world?

2006-08-30 Thread skip
John> Interesting question. Just as a curious follow-up (not being John> someone who works in the programming world), why does it take so John> long to move to the latest version, especially when there aren't John> (I don't think) any changes that would break existing code, such

Re: subprocess woes

2006-08-30 Thread km
Hi Dennis, That works great ! thanks for the correction regards, KM-- On 8/29/06, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: On Tue, 29 Aug 2006 18:17:47 +0530, km <[EMAIL PROTECTED] >declaimed the following in comp.lang.python:> ##code star

Re: How ahead are you guys in the (Python) real world?

2006-08-30 Thread Ray
John Salerno wrote: > > However I wonder, how fast are you guys moving from version to version > > at work? > > Interesting question. Just as a curious follow-up (not being someone who > works in the programming world), why does it take so long to move to the > latest version, especially when there

Re: subprocess woes

2006-08-30 Thread km
Hi Dennis,   That works great. thanks for the correction. The 'output' variable has the returned data as string obbject. how can i get it as a list object with elements as line by line? Is it that p1.communicate()[0] by default returns a single string only ? regards, KM  On 8/29/06, Dennis Lee Bieb

Re: What do you want in a new web framework?

2006-08-30 Thread Alex Martelli
Steve Holden <[EMAIL PROTECTED]> wrote: > Oops, -- not sure how the stray trailing questionmark got in, sorry. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary with object's method as thier items

2006-08-30 Thread John Purser
On 30 Aug 2006 06:35:17 -0700 "noro" <[EMAIL PROTECTED]> wrote: > Is it possible to do the following: > > for a certain class: > > > class C: > > def func1(self): > pass > def func2(self): > pass > def func4(self): > pass > >

Re: where or filter on list

2006-08-30 Thread bearophileHUGS
Duncan Booth: > And for Python 2.5 users only we have the exciting new option of: > >>> foo = [5, 2, -1, -7, 3, -6, 2, 12] > >>> min(foo, key=abs) > -1 Good. This is possibility for older Python: l = [(rnd()-0.5) * 20 for i in xrange(1000)] print min( (abs(el), el) for el in l )[1] Bye, bearophi

Re: time.clock() going backwards??

2006-08-30 Thread Grant Edwards
On 2006-08-29, Ralf Muschall <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: > >> This is a _Microsoft_Product_. There doesn't have to be a >> reason for something to be done in a half-assed manner. > > No, it is a quantum effect. If the energy of a clock has a > lower bound, there must be a no

Re: dictionary with object's method as thier items

2006-08-30 Thread Roberto Bonvallet
noro wrote: > Is it possible to do the following: > > for a certain class: [...] > by some way create a dictionary that look somthing like that: > > d= {'function one': , \ > 'function two': , \ > 'function three': } > > and so i could access every method of instances of C Something l

Re: Python for Windows

2006-08-30 Thread Grant Edwards
On 2006-08-29, mistral <[EMAIL PROTECTED]> wrote: > I need compile code written in Python. I use Windows 98SE. > Should I download Python for Windows installer? > http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi I like the active state windows installs. They contain a few pretty nice extr

Re: dictionary with object's method as thier items

2006-08-30 Thread Bruno Desthuilliers
noro wrote: > Is it possible to do the following: > > for a certain class: > > > class C: > > def func1(self): > pass > def func2(self): > pass > def func4(self): > pass > > obj=C() > > > by some w

What make a great community

2006-08-30 Thread flit
Hi all, I had one problem with csv files. And I put the message on 2 microsoft board and in this group. Results: No response from microsoft, and always 3 responses for posts on this lists. I just want to say thank you for all. And notice that this is a great community.. Flit The brazilian newb

Re: dictionary with object's method as thier items

2006-08-30 Thread Georg Brandl
noro wrote: > Is it possible to do the following: > > for a certain class: > > > class C: > > def func1(self): > pass > def func2(self): > pass > def func4(self): > pass > > obj=C() > > > by some w

Re: How ahead are you guys in the (Python) real world?

2006-08-30 Thread Grant Edwards
On 2006-08-30, John Salerno <[EMAIL PROTECTED]> wrote: > Ray wrote: > >> However I wonder, how fast are you guys moving from version to version >> at work? > > Interesting question. Just as a curious follow-up (not being > someone who works in the programming world), why does it take > so long to m

Re: Coding style and else statements

2006-08-30 Thread Gabriel Genellina
At Wednesday 30/8/2006 04:47, Tal Einat wrote: I meant to say that: (thing and [thing+1] or [-1])[0] is more readable (IMO) than: thing != -1 and (thing and thing+1 or -1) or 0 Interesting to find how different persons feel "readability" - for me, the later is rather clear (but definitivel

Re: Python for Windows

2006-08-30 Thread hg
Grant Edwards wrote: > >> Will the msi installer modify registry or other system files? >> Does it possible install Python not touching registry and >> system files? > You can make your own installer to install Python, and make sure the registry is not touched - I think the current installer mod

windows pagfile utilization

2006-08-30 Thread djoefish
Could anyone help me with this? I am running some memory intensive computations with python on XP, and was running out of memory when the pagefile got full (~2g)...so I reset the windows pagefile to 4g (maximum allowed). My program still crashes at 2g (according to the task manager). Do I need to

Re: Python web service ...

2006-08-30 Thread Gabriel Genellina
At Wednesday 30/8/2006 07:25, NicolasG wrote: You mean to use only python HTTP socket library ? I never had use sockets before, it has a big learning curve ? > >If I want to run my program as a web service I need to setup a > >webserver , am I right ? > >Whars that difference ? can a webservi

Re: Best Practices for Python Script Development?

2006-08-30 Thread metaperl
Ant wrote: > > `Pydoc `_ seems to be > > built around modules and I want to document scripts. > > Any python script *is* a python module. So pydoc is what you are after > here. Yes, but Lundh's PythonDoc looks good too. I'm inclined to go with that.

Re: windows pagfile utilization

2006-08-30 Thread Richard Brodie
"djoefish" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > My program still crashes at 2g (according to the task manager). Do I > need to inform python that the pagefile has a new size? How do I check > that python is utilizing the full pagefile? It won't. You'll hit the 2Gb user

Re: dictionary with object's method as thier items

2006-08-30 Thread Gabriel Genellina
At Wednesday 30/8/2006 10:35, noro wrote: for a certain class: by some way create a dictionary that look somthing like that: d= {'function one': , \ 'function two': , \ 'function three': } and so i could access every method of instances of C, such as obj with sometiing like: (i kno

Re: block a network port

2006-08-30 Thread Tim Williams
On 29 Aug 2006 20:43:49 -0700, alex23 <[EMAIL PROTECTED]> wrote: > abcd wrote: > > ok, no of any python solutions? or command-line firewalls? > > You did try searching Google for "python firewall", right? > > http://www.google.com.au/search?q=python+firewall > > The very first entry is a pointer t

Re: How ahead are you guys in the (Python) real world?

2006-08-30 Thread skip
Grant> So the questions when considering an upgrade are: Grant> 1) Is there a new feature I want? Grant> 2) Is that feature worth fixing the update breaking? 3) Has the version I'm running reached "end of support"? If it has and you encounter a bug, you may be forced to upgra

Re: models & editors in PyQt4

2006-08-30 Thread David Boddie
Skink wrote: > I created simple property classes with editing option, but since i'm not > too much experienced in PyQt4 i'd like to ask if i handle ColorProperty > changing right. Any other Property has its own editor and their control > flow is imho ok. Hovewer i'm not sure about ColorProperty. >

Re: How ahead are you guys in the (Python) real world?

2006-08-30 Thread [EMAIL PROTECTED]
John Salerno wrote: > Interesting question. Just as a curious follow-up (not being someone who > works in the programming world), why does it take so long to move to the > latest version, especially when there aren't (I don't think) any changes > that would break existing code, such as moving to Py

Re: xml.sax.writer

2006-08-30 Thread Fredrik Lundh
Dominic Fox wrote: > xml.sax.writer doesn't appear in the global module documentation, and > googling for it doesn't tell you all that much either. Is it actually > in the standard libraries, or is it an interloper from something else > (the libxml bindings, say) that just happens to have taken up

Re: models & editors in PyQt4

2006-08-30 Thread Skink
David Boddie wrote: > > It should be OK - it shouldn't crash, anyway. It depends on the view > doing the right thing when it finds that it hasn't received an editor > widget. > > You could create an empty placeholder widget in the createEditor() > method, call QColorDialog.getColor() with the exi

Re: dictionary with object's method as thier items

2006-08-30 Thread noro
great that is what i looked for. >>> class C: > ... def function(self, arg): > ... print arg > ... > >>> obj = C() > >>> d = C.__dict__ > >>> d['function'](obj, 42) > 42 this allows me the access the same method in a range of objects. i can put all the functions i need in a dictio

Re: windows pagfile utilization

2006-08-30 Thread Tim Chase
> Not page/swap -- by default Windows only gives 2GB to > applications for data; the rest is held for shared OS kernel > usage. Is it just me or does this seem ludicrous? If I had a bunch of re$ource$ and I employed someone to manage them for me, would I find it acceptable that they consume hal

Re: How ahead are you guys in the (Python) real world?

2006-08-30 Thread John Salerno
[EMAIL PROTECTED] wrote: > The real question in most production environments isn't "why not > upgrade?", it's "why upgrade?". Good way to put it. Now I'm starting to see how much of a pain it can be. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for Windows

2006-08-30 Thread mistral
hg писал(а): > Grant Edwards wrote: > > > > >> Will the msi installer modify registry or other system files? > >> Does it possible install Python not touching registry and > >> system files? > > > You can make your own installer to install Python, and make sure the > registry is not touched - I t

Syntax suggestion.

2006-08-30 Thread samir
Saluton! Being a fond of Python, I had this idea: Why not making Python a Unix shell? But, after a little thinking, i found that the current syntax may be troublesome. For example: to list files in bash I'll do $ ls M* When for Python it will be: >>> import UShell >>> UShell.ls("M*") or >>> U

  1   2   3   >