Re: PATCH: Speed up direct string concatenation by 20+%!

2006-09-30 Thread Steve Holden
Larry Hastings wrote: > Fredrik Lundh wrote: > >>so what does the benchmark look like if you actually do this ? > > > Okay, timing this: > x = "" > for i in range(10): > x += "a" > t = x[1] # forces the concat object to render > > The result: > Python 2.5 release: 30.0s > Pyth

Re: File I/O

2006-09-30 Thread MonkeeSage
Diez B. Roggisch wrote: > Good to know that you can get drunk under any circumstances. +(++)1 heh! > I have seen a bazillion bad xml/html parsing-hacks using regexes and the > like, which stopped working after somehow the xml came all in one line, or > some other implicit assumption about its lay

Re: retry in exception

2006-09-30 Thread Steve Holden
Sybren Stuvel wrote: > Antoine De Groote enlightened us with: > >>I hope I don't upset anybody by comparing Python to Ruby (again). Is >>there something like Ruby's retry keyword in Python? > > > Please don't assume that everybody knows Ruby through and through... > I didn't see any such assum

Re: creating a small test server on my local computer

2006-09-30 Thread Ant
Mirco Wahab wrote: > Thus spoke John Salerno (on 2006-09-29 21:13): ... > My advice would be (because Apache installations on > WinXP don't usually support Python (except pulling > the whole thing into each CGI invocation) - download > and install a VMWare Player This sounds a horribly complicate

why logging re-raise my exception and can't be caught?

2006-09-30 Thread daniel
I use a simple program to illustrate the problem: import logging def foo() : raise ValueError("foo") if __name__ == "__main__" : try : foo() except ValueError : logging.exception("caught here") -- seems re-raise the exception and can't be caught print "caught

Re: storing variable names in a list before they are used?

2006-09-30 Thread Steve Holden
John Salerno wrote: > If I want to have a list like this: > > [(first_name, 'First Name:'), (last_name, 'Last Name:').] > > where the first part of each tuple is a variable name and the second > part is a label for the user to see, such as a form like this: > > First Name: > Last N

Re: The Python world tries to be polite [formerly offensive to another language]

2006-09-30 Thread MonkeeSage
Steve Holden wrote: > Perhaps so, but none the less comp.lang.perl has a demonstrable history > of newbie-flaming. Don't know what it's like now, as it's years since I > read that group, but they used to just love the smell of crisply-toasted > newbie in the morning ;-) C'mon! No reason why a newb

Re: DAT file compilation

2006-09-30 Thread Steve Holden
Jay wrote: > That cgi idea is really cool, but I don't have any web space to host > the files. Plus the bandwidth required would be deadly. I think I'll > just have to stick to the zip file idea. The problem with the > read-only is that this program is aimed at a Windows audience. So don't call

Re: why logging re-raise my exception and can't be caught?

2006-09-30 Thread Ben Finney
"daniel" <[EMAIL PROTECTED]> writes: > I'm expecting the exception to be caught silently, and print the msg to > some place Then why not use logging.error() ? http://docs.python.org/lib/module-logging> = error(msg[, *args[, **kwargs]]) Logs a message with level ERROR on the root logger.

Re: Hot new programming languages - according to the TIOBE index

2006-09-30 Thread MonkeeSage
vasudevram wrote: > Ruby and Python are doing well, according to the latest TIOBE index. Doing well?? Ruby is up 14 points, relatively...ghea! ruby p0wns!11 ;) D is an interesting language, though, I must say. Looks like they did all the things right that C++ did wrong. Regards, Jordan -- http

Re: Python/UNO/OpenOffice?

2006-09-30 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > Are then any currently active and reasonably mature Python plugins/ > apis/whatever for programming/scripting OpenOffice? The page I've > found is http://udk.openoffice.org/python/python-bridge.html, but it > was last updated more than a year ago. Aside fro

Re: for: else: - any practical uses for the else clause?

2006-09-30 Thread Sybren Stuvel
Paul Rubin enlightened us with: >> height = 0 >> for block in stack: >> if block.is_marked(): >> print "Lowest marked block is at height", height >> break >> height += block.height >> else: >> raise SomeError("No marked block") > > all_heights = [block.height for blo

Re: for: else: - any practical uses for the else clause?

2006-09-30 Thread MonkeeSage
Sybren Stuvel wrote: > I must say that the for/else construct is a LOT more readable than the > rewritten alternatives. +1 I just wish it had a more intuitive name like "after:" or "then:", as "else:" seems like a choice between the loop and the other block (but really the choice is between StopI

Re: File I/O

2006-09-30 Thread Ant
Kirt wrote: ... > i dont wanna parse the xml file.. > > Just open the file as: > > f=open('test.xml','a') > > and append a line "abc" before tag The other guys are right - you should look at something like ElementTree which makes this sort of thing pretty easy, and is robust. But if you are sur

Re: Hot new programming languages - according to the TIOBE index

2006-09-30 Thread MonkeeSage
MonkeeSage wrote: > vasudevram wrote: > > Ruby and Python are doing well, according to the latest TIOBE index. > > Doing well?? Ruby is up 14 points, relatively...ghea! ruby p0wns!11 ;) Sorry my fellow pythonistas! I didn't see that this was cross-posted. I was of course being silly, but I wanted

Re: The Python world tries to be polite [formerly offensive to another language]

2006-09-30 Thread Steve Holden
MonkeeSage wrote: > Steve Holden wrote: > >>Perhaps so, but none the less comp.lang.perl has a demonstrable history >>of newbie-flaming. Don't know what it's like now, as it's years since I >>read that group, but they used to just love the smell of crisply-toasted >>newbie in the morning ;-) > >

Re: why logging re-raise my exception and can't be caught?

2006-09-30 Thread Diez B. Roggisch
daniel schrieb: > I use a simple program to illustrate the problem: > > import logging > > def foo() : > raise ValueError("foo") > > if __name__ == "__main__" : > try : > foo() > except ValueError : > logging.exception("caught here") -- seems re-raise the > exception

Re: for: else: - any practical uses for the else clause?

2006-09-30 Thread Paul Rubin
Sybren Stuvel <[EMAIL PROTECTED]> writes: > I must say that the for/else construct is a LOT more readable than the > rewritten alternatives. They are all pretty ugly. I prefer the genexp version with a hypothetical "is_empty" function: all_heights = (block.height for block in stack if block

Re: MySQLdb for Python 2.5

2006-09-30 Thread Martin v. Löwis
Harold Trammel schrieb: > Does anyone know the status of a version of MySQLdb that will work with > Python 2.5? AFAICT, MySQLdb 1.2.1 builds and works just fine. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: why logging re-raise my exception and can't be caught?

2006-09-30 Thread Steve Holden
Ben Finney wrote: [...] > A 'try ... except' statement is not an exception handler. [...] Just as a matter of interest, what would your definition of an exception handler be, then? Specifically, what's the "except" clause for? The docs for looging.except should make it explicit that the exceptio

Re: why logging re-raise my exception and can't be caught?

2006-09-30 Thread daniel
thank your so much firstly. I feel really ashamed... I think I did read through all examples and docs, but I just took for granted that all the info(), warning(), debug() like functions behaves much alike except the level name.. so the description you listed really was ignored,, tks again for

Re: for: else: - any practical uses for the else clause?

2006-09-30 Thread Peter Otten
Sybren Stuvel wrote: > Paul Rubin enlightened us with: >>> height = 0 >>> for block in stack: >>> if block.is_marked(): >>> print "Lowest marked block is at height", height >>> break >>> height += block.height >>> else: >>> raise SomeError("No marked block") >> >> a

Re: why logging re-raise my exception and can't be caught?

2006-09-30 Thread Georg Brandl
Steve Holden wrote: > Ben Finney wrote: > [...] >> A 'try ... except' statement is not an exception handler. [...] > > Just as a matter of interest, what would your definition of an exception > handler be, then? Specifically, what's the "except" clause for? > > The docs for looging.except should

Re: Automatic methods in new-style classes

2006-09-30 Thread bertgoos
The metaclass approach seems to be the one I was looking for. Thanks! Bert -- http://mail.python.org/mailman/listinfo/python-list

Re: Leave the putdowns in the Perl community, the Python world does not need them

2006-09-30 Thread Pierre Quentel
I am also shocked by Fredrick Lundh's impoliteness and think he makes this group less friendly than I expected when I read this on http://www.python.org/community/lists/: "Rudeness and personal attacks, even in reaction to blatant flamebait, are strongly frowned upon. People may strongly disagree

Re: for: else: - any practical uses for the else clause?

2006-09-30 Thread Peter Otten
Paul Rubin wrote: > Sybren Stuvel <[EMAIL PROTECTED]> writes: >> I must say that the for/else construct is a LOT more readable than the >> rewritten alternatives. > > They are all pretty ugly. I prefer the genexp version with a > hypothetical "is_empty" function: > > all_heights = (block.h

Re: for: else: - any practical uses for the else clause?

2006-09-30 Thread Paul Rubin
Peter Otten <[EMAIL PROTECTED]> writes: > I like > > def blocks_til_mark(stack): > for block in stack: > if block.is_marked(): > return > yield block > raise SomeError > height = sum(block.height for block in blocks_til_mark(stack)) Oh my, I realize now that I

Re: for: else: - any practical uses for the else clause?

2006-09-30 Thread Paul Rubin
Peter Otten <[EMAIL PROTECTED]> writes: > > all_heights = (block.height for block in stack if block.is_marked()) > > if is_empty(all_heights): > > raise SomeError("No marked block") > > Such a function would have to rebind the generator: Yeah, that's what I mean about generators

Re: ruby %w equivalent

2006-09-30 Thread MonkeeSage
Nick Craig-Wood wrote: > These are snatched straight from perl. In perl they are spelt > slightly differently Yup, they are; perl had _some_ good ideas; no doubt. ;) > In perl (and maybe in ruby I don't know) the { } can be replaced with > any two identical chars, or the matching pair if bracket

Escapeism

2006-09-30 Thread Kay Schluehr
Usually I struggle a short while with \ and either succeed or give up. Today I'm in a different mood and don't give up. So here is my question: You have an unknown character string c such as '\n' , '\a' , '\7' etc. How do you echo them using print? print_str( c ) prints representation '\a' to st

Filter class

2006-09-30 Thread TheSaint
Hello NG, Curious to know whether exists a filter class. I'm doing some rough mail filtering on my own criteria, but I'm very new on programming and I like to find some clue on passing a config file of rules which will be regex by Python. TIA -- http://mail.python.org/mailman/listinfo/python-lis

Re: for: else: - any practical uses for the else clause?

2006-09-30 Thread Peter Otten
Paul Rubin wrote: > Peter Otten <[EMAIL PROTECTED]> writes: >> > all_heights = (block.height for block in stack if >> > block.is_marked()) if is_empty(all_heights): >> > raise SomeError("No marked block") >> >> Such a function would have to rebind the generator: > > Yeah, that'

builtin regular expressions?

2006-09-30 Thread Antoine De Groote
Hello, Can anybody tell me the reason(s) why regular expressions are not built into Python like it is the case with Ruby and I believe Perl? Like for example in the following Ruby code line = 'some string' case line when /title=(.*)/ puts "Title is #$1" when /track=(.*)/ puts "

Re: Escapeism

2006-09-30 Thread Peter Otten
Kay Schluehr wrote: > Usually I struggle a short while with \ and either succeed or give up. > Today I'm in a different mood and don't give up. So here is my > question: > > You have an unknown character string c such as '\n' , '\a' , '\7' etc. > > How do you echo them using print? > > print_st

Re: builtin regular expressions?

2006-09-30 Thread Sybren Stuvel
Antoine De Groote enlightened us with: > Can anybody tell me the reason(s) why regular expressions are not built > into Python like it is the case with Ruby and I believe Perl? They _are_ built into Python. Python ships with the 're' module. > Python Culture says: 'Explicit is better than implic

Re: Escapeism

2006-09-30 Thread Sybren Stuvel
Kay Schluehr enlightened us with: > Usually I struggle a short while with \ and either succeed or give up. > Today I'm in a different mood and don't give up. So here is my > question: > > You have an unknown character string c such as '\n' , '\a' , '\7' etc. > > How do you echo them using print? >

Re: MySQLdb for Python 2.5

2006-09-30 Thread James Stroud
Harold Trammel wrote: > Hi everyone, > > Does anyone know the status of a version of MySQLdb that will work with > Python 2.5? I will accept a workaround if you know one. Thanks in > advance. > > Harold Trammel I could not find a way around this requirement, but you will want to manually ad

Re: ruby %w equivalent

2006-09-30 Thread James Stroud
hg wrote: > But today ? what is the cost of replacing %w("blah blah") by > Hi_I_Want_To_Split_The_String_That_Follows( "blah blah") The latter is beginning to look like the Cocoa/NextStep framework. Perhaps we should give up scripting languages for ObjC? James -- http://mail.python.org/mailman/

Re: another distutils question

2006-09-30 Thread Keith Perkins
Thanks everyone, for your answers. They've been very helpful. Keith -- http://mail.python.org/mailman/listinfo/python-list

Re: windev vs python SOS

2006-09-30 Thread Wolfgang Keller
> - python work on multiple platform (linux, mac, windows) > A good point but it didn't interest him. Because > we want to choose a language for prototyping. > So multi platform is not enough. With Python the prototype _is_ the application. You just need to add a little bit of

Re: for: else: - any practical uses for the else clause?

2006-09-30 Thread Paul Rubin
Peter Otten <[EMAIL PROTECTED]> writes: > > all_heights = lambda: > > (block.height for block in stack if > > block.is_marked()) > > You still need the stop() trick to omit the heights after the marked block. Yeah, that code was based on my earlier m

Storing records from a parsed file

2006-09-30 Thread Ben
Apologies if this is te wrong place to post - I realise the question is pretty basic... I have a simple python script that parses a text file and extracts data from it. Currently this data is stored in a list by a function, each element of which is an instance of a class with member variables to

Re: builtin regular expressions?

2006-09-30 Thread Jorge Godoy
Antoine De Groote <[EMAIL PROTECTED]> writes: > Hello, > > Can anybody tell me the reason(s) why regular expressions are not built into > Python like it is the case with Ruby and I believe Perl? Like for example in > the following Ruby code > > line = 'some string' > > case line > when /title=(.

Typing UTF-8 characters in IDLE

2006-09-30 Thread kazuo fujimoto
Ricky, I found your message now, because I also would encounter the same problem. > A few unicode tutorials on the web show that it's possible to type > unicode characters into the IDLE gui... > > However, when i type korean (hangul) characters it complains: > > Unsupported Characters in input

Re: builtin regular expressions?

2006-09-30 Thread John Roth
Antoine De Groote wrote: > Hello, > > Can anybody tell me the reason(s) why regular expressions are not built > into Python like it is the case with Ruby and I believe Perl? Like for > example in the following Ruby code > > line = 'some string' > > case line >when /title=(.*)/ > puts "Tit

Python pyphone module download

2006-09-30 Thread vedran_dekovic
Hello, I was install python pyphone,but I can't run it becose I must download module gtk.Where to I find module gtk (gtk.exe) Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Storing records from a parsed file

2006-09-30 Thread Steve Holden
Ben wrote: > Apologies if this is te wrong place to post - I realise the question > is pretty basic... > > I have a simple python script that parses a text file and extracts data > from it. Currently > this data is stored in a list by a function, each element of which is > an instance of a class

Re: Storing records from a parsed file

2006-09-30 Thread Ben
Ah I see. So istead of creating the classes diectly I use a facroty class as a buffer - I tell it what I want and it makes the appropriate instances. I am not enitely sure that applies here though (I may be wrong) Currently I have: camera_list[] class camera: def __init__(self,alpha,beta,ga

cx_Freeze and Python

2006-09-30 Thread BM
Hi. Does somebody used cx_Freeze, especially on Mac? I have a trouble to make *standalone* program. If I use dynamically compiled Python as it done by default, I always have an "hardcoded" URL inside the Python binary something like /usr/local/Python2.5/lib/libpython so after I freeze stuff and

Re: Storing records from a parsed file

2006-09-30 Thread Ben
Ah - I think I've sorted it out. I can now have data1.function() or data2.function() etc However, I can still call function() directly: function() which seems very odd Indeed. The only instances of function are within classes data1 and data2, and these definitions are different, so I don'

Re: builtin regular expressions?

2006-09-30 Thread Mirco Wahab
Thus spoke Antoine De Groote (on 2006-09-30 11:24): > Can anybody tell me the reason(s) why regular expressions are not built > into Python like it is the case with Ruby and I believe Perl? Like for > example in the following Ruby code > I'm sure there are good reasons, but I just don't see them

Re: builtin regular expressions?

2006-09-30 Thread Mirco Wahab
Thus spoke Jorge Godoy (on 2006-09-30 14:37): > Antoine De Groote <[EMAIL PROTECTED]> writes: >> I'm sure there are good reasons, but I just don't see them. >> Python Culture says: 'Explicit is better than implicit'. May it be related to >> this? > > See if this isn't better to read: > > def prin

Re: builtin regular expressions?

2006-09-30 Thread Duncan Booth
Jorge Godoy <[EMAIL PROTECTED]> wrote: > See if this isn't better to read: > > > > def print_message(some_str): > if some_str.startswith('track='): > print "Your track is", some_str[6:] > elif some_st

Re: builtin regular expressions?

2006-09-30 Thread Steve Holden
Mirco Wahab wrote: > Thus spoke Antoine De Groote (on 2006-09-30 11:24): > > >>Can anybody tell me the reason(s) why regular expressions are not built >>into Python like it is the case with Ruby and I believe Perl? Like for >>example in the following Ruby code >>I'm sure there are good reasons,

Re: builtin regular expressions?

2006-09-30 Thread Jorge Godoy
Mirco Wahab <[EMAIL PROTECTED]> writes: > I don't see the point here, this example can be > translated amost 1:1 to Perl and gets much more > readable in the end, consider: I could make it shorter in Python as well. But for a newbie that haven't seen the docs for strings in Python I thought the

Re: builtin regular expressions?

2006-09-30 Thread Jorge Godoy
Duncan Booth <[EMAIL PROTECTED]> writes: > Or you could make it even clearer by using a loop: Oops. Should have read your message before replying to Mirco. But again, since the OP didn't read the docs for string operations I tried the terse approach so that he actually sees the correspondence f

Re: Storing records from a parsed file

2006-09-30 Thread Ben
Finally got it all sorted :-) I got slightly confused because it seems that if you refer to class variables from methods within that class you need to explicitly state that they are self, otherwise, since class variables are all public in python, things could get quite confusing. Ben Ben wrote:

_gtk

2006-09-30 Thread vedran_dekovic
Hello, Where to I download module: _gtk -- http://mail.python.org/mailman/listinfo/python-list

Re: builtin regular expressions?

2006-09-30 Thread Mirco Wahab
Thus spoke Jorge Godoy (on 2006-09-30 17:50): > Mirco Wahab <[EMAIL PROTECTED]> writes: > > I could make it shorter in Python as well. But for a newbie that haven't seen > the docs for strings in Python I thought the terse version would be more > interesting. OK > At least he'll see that there

Re: _gtk

2006-09-30 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hello, > Where to I download module: _gtk is google dead today? google: python module gtk download windows something like the fifth link. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: windev vs python SOS

2006-09-30 Thread Amanda
> Can Windev interface with .net? YES > Can Windev interface with Java? YES > Can Windev interface natively with nearly every relational database on the > planet? YES > Does Windev interface with JMS, Java RMI, SAP RFC, mqseries and other > middleware?>> YES > Can you easily

Re: _gtk

2006-09-30 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > Hello, > Where to I download module: _gtk I would suggest starting here: http://www.pygtk.org/downloads.html It looks like you need the PyGTK package. Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: creating a small test server on my local computer

2006-09-30 Thread John Salerno
Ant wrote: > Mirco Wahab wrote: >> Thus spoke John Salerno (on 2006-09-29 21:13): > ... >> My advice would be (because Apache installations on >> WinXP don't usually support Python (except pulling >> the whole thing into each CGI invocation) - download >> and install a VMWare Player > > This sound

Re: Mark Lutz Python interview

2006-09-30 Thread John Salerno
Fuzzyman wrote: > Mark Lutz wrote: >> Python author and trainer Mark Lutz will be interviewed >> on the radio show Tech Talk this Sunday, October 1st, >> at 6PM Eastern time. He'll be answering questions about >> Python, his books, and his Python training services. >> > > Does he always talk in t

Re: for: else: - any practical uses for the else clause?

2006-09-30 Thread Carl Banks
[EMAIL PROTECTED] wrote: > I'm wondering if anyone has ever found a practical use for the else > branch? Say you have code that looks like this: if command.startswith("set"): do_set_action(command) elif command.startswith("input"): do_input_action(command) elif command.startswith("print")

Re: does anybody earn a living programming in python?

2006-09-30 Thread Brad Allen
I'll attest that we have a shortage of Python developers in the Dallas area; in the DFW Python user group (dfwpython.org) we occasionally encounter local employers who have trouble finding local Python developers who can take on new work. Most of the group members are already employed, so the stand

Re: storing variable names in a list before they are used?

2006-09-30 Thread John Salerno
John Salerno wrote: > (the variables would store whatever information is entered in the text > boxes to the right of each label. I'm doing it this way so I can write a > loop to construct my GUI components). Thanks very much for the responses guys. I actually tried something similar with a dic

Re: DAT file compilation

2006-09-30 Thread Roger Upole
On Windows NTFS file systems, you can add data to a file using named streams. The extra streams aren't visible from Explorer so the average end-user won't even know they're there. Roger "Jay" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > That cgi idea is really cool, but

Re: MySQLdb for Python 2.5

2006-09-30 Thread Jan Dries
Martin v. Löwis wrote: > Harold Trammel schrieb: >> Does anyone know the status of a version of MySQLdb that will work with >> Python 2.5? > > AFAICT, MySQLdb 1.2.1 builds and works just fine. > Does anyone know if Windows binaries for 2.5 are available somewhere? Regards, Jan -- http://mail

PyCon 2007: What talks/tutorials/panels do you want to see?

2006-09-30 Thread Brad Allen
This thread is for posting ideas and general brainstorming about what kinds of talks folks would be interested in seeing at PyCon 2007. The idea is to inspire volunteer speakers to propose talks that they might not otherwise realize would be popular, and to give PyCon organizers a whiff of fresh co

Re: Escapeism

2006-09-30 Thread Kay Schluehr
Sybren Stuvel wrote: > Kay Schluehr enlightened us with: > > Usually I struggle a short while with \ and either succeed or give up. > > Today I'm in a different mood and don't give up. So here is my > > question: > > > > You have an unknown character string c such as '\n' , '\a' , '\7' etc. > > > >

Re: builtin regular expressions?

2006-09-30 Thread Jorge Godoy
Mirco Wahab <[EMAIL PROTECTED]> writes: > sub print_message { > if (/^track="(.+?)"/ ){ print "Your track is $1\n" } > ... > > which has a "more complicated" regex that is usually > not understood easily by newbies. Specially the non-greedy part. :-) I don't believe that non-greedyn

Re: builtin regular expressions?

2006-09-30 Thread Antoine De Groote
Just to get it clear at the beginning, I started this thread. I'm not a newbie (don't get me wrong, I don't see this as an insult whatsoever, after all, you couldn't know, and I appreciate it being so nice to newbies anyway). I'm not an expert either, but I'm quite comfortable with the language

Re: Escapeism

2006-09-30 Thread Duncan Booth
"Kay Schluehr" <[EMAIL PROTECTED]> wrote: >> try "print repr(c)". > > This yields the hexadecimal representation of the ASCII character and > does not simply echo the keystrokes '\' and 'a' for '\a' ignoring the > escape semantics. But you yourself noted earlier that '\a' and '\x07' are the same

Re: The Python world tries to be polite [formerly offensive to another language]

2006-09-30 Thread A.M. Kuchling
On Sat, 30 Sep 2006 09:10:14 +0100, Steve Holden <[EMAIL PROTECTED]> wrote: > My God, Perl 6 is going to be even less comprehensible that Perl 5, > which was at least usable. Is »=>« really a Perl6 operator? That's too > funny! While we poor Python people have to cope with writing:

Re: builtin regular expressions?

2006-09-30 Thread Jorge Godoy
Antoine De Groote <[EMAIL PROTECTED]> writes: > Just to get it clear at the beginning, I started this thread. I'm not a newbie Sorry :-) I got to this wrong conclusion because of the way I read your message. > an expert either, but I'm quite comfortable with the language by now. It's > just tha

Re: creating a small test server on my local computer

2006-09-30 Thread Steve Holden
John Salerno wrote: > Ant wrote: > >>Mirco Wahab wrote: >> >>>Thus spoke John Salerno (on 2006-09-29 21:13): >> >>... >> >>>My advice would be (because Apache installations on >>>WinXP don't usually support Python (except pulling >>>the whole thing into each CGI invocation) - download >>>and insta

loop over list and modify in place

2006-09-30 Thread Daniel Nogradi
Is looping over a list of objects and modifying (adding an attribute to) each item only possible like this? mylist = [ obj1, obj2, obj3 ] for i in xrange( len( mylist ) ): mylist[i].newattribute = 'new value' I'm guessing there is a way to do this without introducing the (in principle unnec

Re: DAT file compilation

2006-09-30 Thread Steve Holden
Roger Upole wrote: > On Windows NTFS file systems, you can add data to a file using named streams. > The extra streams aren't visible from Explorer so the average end-user won't > even know they're there. > I hadn't realised how easy it is to access alternate data streams from Python. A filename

Re: Python/UNO/OpenOffice?

2006-09-30 Thread wesley chun
as others have said, that project provides a working interface to OOo (OpenOffice 2 on Ubuntu Breezy and Dapper). i've made several posts to this regard over the summer here on CLP. i was mostly using it to "mess around" with documents in StarWriter. cheers, -- wesley - - - - - - - - - - - - - -

Re: Escapeism

2006-09-30 Thread Steve Holden
Kay Schluehr wrote: > Sybren Stuvel wrote: > >>Kay Schluehr enlightened us with: >> >>>Usually I struggle a short while with \ and either succeed or give up. >>>Today I'm in a different mood and don't give up. So here is my >>>question: >>> >>>You have an unknown character string c such as '\n' ,

Re: loop over list and modify in place

2006-09-30 Thread Daniel Nogradi
> Is looping over a list of objects and modifying (adding an attribute > to) each item only possible like this? > > mylist = [ obj1, obj2, obj3 ] > > for i in xrange( len( mylist ) ): > mylist[i].newattribute = 'new value' > > > I'm guessing there is a way to do this without introducing the (in

Re: builtin regular expressions?

2006-09-30 Thread Antoine De Groote
Jorge Godoy wrote: > Antoine De Groote <[EMAIL PROTECTED]> writes: > >> Just to get it clear at the beginning, I started this thread. I'm not a >> newbie > > Sorry :-) I got to this wrong conclusion because of the way I read your > message. no problem ;-) maybe my formulation was a bit naive,

Re: DAT file compilation

2006-09-30 Thread Roger Upole
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Roger Upole wrote: >> On Windows NTFS file systems, you can add data to a file using named streams. >> The extra streams aren't visible from Explorer so the average end-user won't >> even know they're there. >> > I hadn't

Re: storing variable names in a list before they are used?

2006-09-30 Thread John Salerno
John Salerno wrote: > Here is what I want to do more specifically: Ok, I'm sure you all get the idea by now, but here's a simpler way to look at it: Instead of first_name = wx.TextCtrl(self) last_name = wx.TextCtrl(self) job_title = wx.TextCtrl(self) etc. and subsequently: sizer.Add(first_na

Re: builtin regular expressions?

2006-09-30 Thread MRAB
Antoine De Groote wrote: > Just to get it clear at the beginning, I started this thread. I'm not a > newbie (don't get me wrong, I don't see this as an insult whatsoever, > after all, you couldn't know, and I appreciate it being so nice to > newbies anyway). I'm not an expert either, but I'm quite

Native MP3 Decoder?

2006-09-30 Thread floguy
I've been working on a simple cross-platform alarm clock application in Python. I took the time to learn wxPython for the frontend, and figured there would be some backend for decoding mp3s to play at alarm time. So far, I have found 3 viable options. 1) pyMedia, which works great, but only work

Re: Escapeism

2006-09-30 Thread Kay Schluehr
Steve Holden wrote: > Kay Schluehr wrote: > > Sybren Stuvel wrote: > > > >>Kay Schluehr enlightened us with: > >> > >>>Usually I struggle a short while with \ and either succeed or give up. > >>>Today I'm in a different mood and don't give up. So here is my > >>>question: > >>> > >>>You have an unk

Re: builtin regular expressions?

2006-09-30 Thread Thorsten Kampe
* Steve Holden (Sat, 30 Sep 2006 17:46:03 +0100) > Mirco Wahab wrote: > > Thus spoke Antoine De Groote (on 2006-09-30 11:24): > Tim Peters frequently says something along the lines of "If you have a > problem and you try to solve it with regexes, then you have TWO > problems". It's originally f

Re: for: else: - any practical uses for the else clause?

2006-09-30 Thread BJörn Lindqvist
> How do you transform this? > > height = 0 > for block in stack: >if block.is_marked(): >print "Lowest marked block is at height", height >break >height += block.height > else: >raise SomeError("No marked block") def get_height_of_first_marked_bock(stack): height =

Re: builtin regular expressions?

2006-09-30 Thread Mirco Wahab
Thus spoke Jorge Godoy (on 2006-09-30 19:04): > Mirco Wahab <[EMAIL PROTECTED]> writes: >> sub print_message { >> if (/^track="(.+?)"/ ){ print "Your track is $1\n" } >> ... > > Specially the non-greedy part. :-) I don't believe that non-greedyness would > be adequate here since I be

Re: Mark Lutz Python interview

2006-09-30 Thread Mark Lutz
Fuzzyman wrote: > Mark Lutz wrote: > > Python author and trainer Mark Lutz will be interviewed > > on the radio show Tech Talk this Sunday, October 1st, > > at 6PM Eastern time. He'll be answering questions about > > Python, his books, and his Python training services. > > > > Does he always talk

Re: loop over list and modify in place

2006-09-30 Thread James Stroud
Daniel Nogradi wrote: > Is looping over a list of objects and modifying (adding an attribute > to) each item only possible like this? > > mylist = [ obj1, obj2, obj3 ] > > for i in xrange( len( mylist ) ): >mylist[i].newattribute = 'new value' > > > I'm guessing there is a way to do this wi

Re: Typing UTF-8 characters in IDLE

2006-09-30 Thread [EMAIL PROTECTED]
thanks, it is useful. but ,why this line "encoding = locale.getdefaultlocale()[1]" in original file"IOBinding.py " , don't work? it should be work kazuo fujimoto wrote: > Ricky, > > I found your message now, because I also would encounter the same > problem. > > > > A few unicode tutorials on

Re: Native MP3 Decoder?

2006-09-30 Thread MonkeeSage
[EMAIL PROTECTED] wrote: > If anyone knows of another project like this, an alternative that I > haven't found yet, or has experience in mp3 decoding, please respond > with your thoughts. There's pymad ( http://spacepants.org/src/pymad/ ); haven't tried but it should work everywhere libmad does.

Re: builtin regular expressions?

2006-09-30 Thread Mirco Wahab
Thus spoke MRAB (on 2006-09-30 20:54): > Antoine De Groote wrote: >> I just have to learn accept the fact that Python is more verbose more >> often than Ruby (I don't know Perl really). > > One of the differences between the Python way and the Perl way is that > the Perl way has a side-effect: Per

Re: Computer Language Popularity Trend

2006-09-30 Thread Arne Vajhøj
Danno wrote: > Xah Lee wrote: >> This page gives a visual report of computer languages's popularity, as >> indicated by their traffic level in newsgroups. This is not a >> comprehensive or fair survey, but does give some indications of >> popularity trends. >> >> http://xahlee.org/lang_traf/index.h

PyXML not supported, what to use next?

2006-09-30 Thread Paul Watson
It would appear that xml.dom.minidom or xml.sax.* might be the best thing to use since PyXML is going without support. Best of all it is included in the base Python distribution, so no addition hunting required. Is this right thinking? Is there a better solution? -- http://mail.python.org/mai

Re: Native MP3 Decoder?

2006-09-30 Thread floguy
I did see that, but that seems to only work on Lin/Unix. In fact, the only way that I can see to install that package is using distutils and the config_unix.py script, which indicates to me that it works only on Lin/Unix. If I'm mistaken, please let me know. MonkeeSage wrote: > [EMAIL PROTECTED]

Upgrading Problems

2006-09-30 Thread Javier Subervi
Hi;I have python 2.3.5 and I'd like to upgrade to 2.5.0. I've tried installing from FreeBSD ports and the oldfashioned way from source code, with the "configure && make && make install" dance, and still when I call up my python interpreter it tells me I'm in 2.3.5! Why? I didn't do "altinstall"! Wh

  1   2   >