Re: Retrieving event descriptors in Tkinter

2006-05-08 Thread Avi Kak
Thanks very much. That's exactly what I was looking for. --- Avi -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's regular expression?

2006-05-08 Thread Duncan Booth
Nick Craig-Wood wrote: > Which translates to > > match = re.search('(blue|white|red)', t) > if match: > print "Colour:", match.group(1) > else: > match = re.search('(socks|tights)', t) > if match: > print "Garment:", match.group(1) > else: > match = re.se

connect file object to standard output?

2006-05-08 Thread beliavsky
I want to write a function that writes to an output file if specified and otherwise to standard output. How can I connect a file object to standard output in the code below? I could use an if statement to choose between print and print>>fp throughout the function, but this seems awkward. I think th

Re: connect file object to standard output?

2006-05-08 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > I want to write a function that writes to an output file if specified > and otherwise to standard output. How can I connect a file object to > standard output in the code below? I could use an if statement to > choose between print and print>>fp throughout the function,

Re: which is better, string concatentation or substitution?

2006-05-08 Thread Roy Smith
John Salerno <[EMAIL PROTECTED]> wrote: >Roy Smith wrote: > >> One may be marginally faster, but they both require copying the source >> string, and are thus both O(n). > >Sorry, I'm not familiar with the O(n) notation. OK, here's a quick tutorial to "big-oh" notation. It's a way of measuring a

Re: connect file object to standard output?

2006-05-08 Thread Larry Bates
[EMAIL PROTECTED] wrote: > I want to write a function that writes to an output file if specified > and otherwise to standard output. How can I connect a file object to > standard output in the code below? I could use an if statement to > choose between print and print>>fp throughout the function, b

help with Linker dependencies missing went compiling mysql-python on Windows without VisualStudio

2006-05-08 Thread Jorge Vargas
Hi everyone I'm stuck at doing this and can't find the problem, maybe someone with more experience then I compiling python can help me out. I google around and found some old articles, from them the one that seems more accurate is http://www.vrplumber.com/programming/mstoolkit/of couse I had to di

converting to scgi

2006-05-08 Thread Eric S. Johansson
I'm looking for a scgi modules that make it easy to convert a CGI using the standard Python CGI module. I'm hoping for something that will run my program either as scgi or cgi. I did find something called paste which purports to be some sort of CGI Bridge framework but from the documentation,

Re: which is better, string concatentation or substitution?

2006-05-08 Thread Ted
Thank you Roy. It seems if you lurk here long enough you eventually get all you questions answered without even asking! ;-) Roy Smith wrote: > John Salerno <[EMAIL PROTECTED]> wrote: > >Roy Smith wrote: > > > >> One may be marginally faster, but they both require copying the source > >> string,

List Ctrl

2006-05-08 Thread carlosperezs
Hello together !! I have programmed a List Control and I introduced information in several rows. What I want to do is, modify this information when i select a row and press a button. There two options: - when i do this, a window appears and asks me to introduce the information. - or in the s

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Ken Tilton
David C. Ullrich wrote: > On Sun, 07 May 2006 10:36:00 -0400, Ken Tilton <[EMAIL PROTECTED]> > wrote: > > >>[...] >> >>Your spreadsheet does not have slots ruled by functions, it has one slot >>for a dictionary where you store names and values/formulas. >> >>Go back to your example and arrange

Re: which is better, string concatentation or substitution?

2006-05-08 Thread John Salerno
Roy Smith wrote: > OK, here's a quick tutorial to "big-oh" notation. Wow, that was fantastic (and interesting)! Did you just write that? That should be saved somewhere! Mind if I post it on my website? (don't worry, no one goes there anyway) :) -- http://mail.python.org/mailman/listinfo/pytho

Re: which is better, string concatentation or substitution?

2006-05-08 Thread Roy Smith
In article <[EMAIL PROTECTED]>, John Salerno <[EMAIL PROTECTED]> wrote: >Roy Smith wrote: > >> OK, here's a quick tutorial to "big-oh" notation. > >Wow, that was fantastic (and interesting)! Did you just write that? That >should be saved somewhere! Mind if I post it on my website? (don't >worry

Re: regular expressions, substituting and adding in one step?

2006-05-08 Thread Paul McGuire
"John Salerno" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ok, this might look familiar. I'd like to use regular expressions to > change this line: > > self.source += '' + paragraph + '\n\n' > > to read: > > self.source += '%s\n\n' % paragraph > John - You've been asking for re-b

Re: ANN: eric3 3.9.0 released

2006-05-08 Thread Detlev Offenbach
J. A. Gaeta Mendes wrote: > Petr Jakes wrote: > >> I think you can get the answer on >> http://www.die-offenbachs.de/detlev/eric3-mailinglist.html >> rather then here. >> >> HTH >> >> Petr Jakes > Thanks Petr, I've got help there. > To those interested, the problem was PyKDE was missing. > To

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Joe Marshall
Alex Martelli wrote: > Ken Tilton <[EMAIL PROTECTED]> wrote: >... > > But the key in the whole thread is simply that indentation will not > > scale. Nor will Python. > > Absolutely. That's why firms who are interested in building *seriously* > large scale systems, like my employer (and suppli

Re: Python Graphics Library

2006-05-08 Thread Scott David Daniels
utab wrote: > Dear all, > > Could you please recommend me a graphics library for python. I saw PYX > which has nice screenshots on the webpage. > > My first ambition is to be able to draw 2D or 3D graphs for my > mathematical results. Maybe later, I can handle other types of > graphical operation

Re: 4 little Python programs

2006-05-08 Thread RM
Terry, Thanks for the feedback. I've done what you said, except for deleting the EXEs. While people on this forum can figure out how to get them to work with just the source, most people will be better off with the installers. I also added screen shots to each of the programs. I am especially

Re: Problem with iterators and inheritance

2006-05-08 Thread Scott David Daniels
Yves wrote: (in surprise because C's __init__ doesn't over-ride next) > class A(object): > def __init__(self, n): self.n = n > def __iter__(self): return self > def next(self): > if self.n > 0: > self.n -= 1 > return "A: %d" % self.n > else: raise

advanced number recognition in strings?

2006-05-08 Thread [EMAIL PROTECTED]
Hi everybody, we want extract numbers from strings and wonder if there is already a module around for doing this. An example in our case would look like this: 0.032 +/- 0.5 x 10(-4) it would even be helpful to have a routine which does not recognise the +/- , but at least the 10(-4). Thank you

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Joe Marshall
Alex Martelli wrote: > > Your "pragmatic benefits", if such they were, would also apply to the > issue of "magic numbers", which was discussed in another subthread of > this unending thread; are you therefore arguing, contrary to widespread > opinion [also concurred in by an apparently-Lisp-orient

Re: advanced number recognition in strings?

2006-05-08 Thread Roy Smith
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >we want extract numbers from strings and wonder if there is already a >module around for doing this. An example in our case would look like >this: > >0.032 +/- 0.5 x 10(-4) > >it would even be helpful to have a routine which does not recognise the >+/-

Re: "Only one obvious way..."

2006-05-08 Thread Raffael Cavallaro
On 2006-05-08 02:51:22 -0400, [EMAIL PROTECTED] said: > The phrase "only one obvious way..." is nearly the most absurd > marketing bullshit I have ever heard; topped only by "it fits your > brain". Why are so many clearly intelligent and apparently > self-respecting hard-core software engineers re

Re: which is better, string concatentation or substitution?

2006-05-08 Thread John Salerno
Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > John Salerno <[EMAIL PROTECTED]> wrote: >> Roy Smith wrote: >> >>> OK, here's a quick tutorial to "big-oh" notation. >> Wow, that was fantastic (and interesting)! Did you just write that? That >> should be saved somewhere! Mind if I post it on

Re: Logging vs printing

2006-05-08 Thread alisonken1
Leo Breebaart wrote: > Also, assume that I have set it up as above. Now I want certain > other print statements to go to sys.stderr alone. If I understand > the docs correctly (possibly I don't), the way to do this is to > start attaching explicit StreamHandlers and whatnot. Whereas with > print

Re: utility functions within a class?

2006-05-08 Thread Scott David Daniels
John Salerno wrote: > John Salerno wrote: >> [EMAIL PROTECTED] wrote: >>> John Salerno wrote: What I originally meant was that they would not be called from an instance *outside* the class itself, i.e. they won't be used when writing another script, they are only used by the class it

Re: Getting HTTP responses - a python linkchecking script.

2006-05-08 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Rene Pijlman wrote: >> [EMAIL PROTECTED]: >>> with urllib2 it doesn't seem possible to get HTTP status codes. >> except urllib2.HTTPError, e: >> if e.code == 403: > > Thanks. Is there documentation for this available somewhere online, I > can't see i

Using StopIteration

2006-05-08 Thread tkpmep
I create list of files, open each file in turn, skip past all the blank lines, and then process the first line that starts with a number (see code below) filenames=glob.glob("C:/*.txt") for fn in filenames: f =file(fn) line = " " while line[0] not in digits: line = f.next()

ALERT - GroupShield ticket number OB20_1147112369_EXCHANGE_3 was generated

2006-05-08 Thread GroupShield for Exchange (EXCHANGE)
Action Taken: The message was quarantined and replaced with a text informing the recipient of the action taken. To: python-list@python.org From: Jorge Vargas <[EMAIL PROTECTED]> Sent: -235532672,29782731 Subject: help with Linker dependencies missing went compiling mysql-python on Windows with

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Ken Tilton
[Sorry, i was just reading comp.lang.lisp, missed the following till someone mentioned it in email. k] Alex Martelli wrote: > Carl Friedrich Bolz <[EMAIL PROTECTED]> wrote: >... > >>>an extension that allows the programmer to specify how the value of >>>some slot (Lisp lingo for "member vari

Re: python rounding problem.

2006-05-08 Thread Thomas Bartkus
"Gary Wessle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Erik Max Francis <[EMAIL PROTECTED]> writes: > > > chun ping wang wrote: > > > > > Hey i have a stupid question. > > > How do i get python to print the result in only three decimal > > > place... > > > Example>>> round (2.9

Re: Using StopIteration

2006-05-08 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I create list of files, open each file in turn, skip past all the blank > lines, and then process the first line that starts with a number (see > code below) > > filenames=glob.glob("C:/*.txt") > for fn in filenames: f = open(fn) for line in f: if

Re: Using StopIteration

2006-05-08 Thread Steve R. Hastings
On Mon, 08 May 2006 11:23:28 -0700, tkpmep wrote: > I create list of files, open each file in turn, skip past all the blank > lines, and then process the first line that starts with a number (see > code below) Here is what I suggest for you: filenames=glob.glob("C:/*.txt") for fn in filenames:

Re: Using StopIteration

2006-05-08 Thread vbgunz
sequence = ['','2'] for index, line in enumerate(sequence): if line.isspace():continue if line[:1].isdigit(): print 'index %s: starts with digit %s' % (index, line[:1]) -- http://mail.python.org/mailman/listinfo/python-list

Re: noob question: "TypeError" wrong number of args

2006-05-08 Thread Holger
And thank you gentlemen for turning my somewhat banale question into a worthwhile discussion. :-) I shall not forget self ever again! -- http://mail.python.org/mailman/listinfo/python-list

Re: Using StopIteration

2006-05-08 Thread vbgunz
to catch and recover from StopIterations, use this: try: raise StopIteration except StopIteration: print 'caught StopIteration!' # verbose: sys.exc_info() requires import sys -- http://mail.python.org/mailman/listinfo/python-list

Re: utility functions within a class?

2006-05-08 Thread John Salerno
Dennis Lee Bieber wrote: > tOn Mon, 08 May 2006 14:04:34 GMT, John Salerno > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> I tried the underscore method, but I was still able to call it as a >> regular instance method in the interpreter. Is that what's supposed to >> happ

Re: converting to scgi

2006-05-08 Thread Damjan
> I'm looking for a scgi modules that make it easy to convert a CGI using > the standard Python CGI module. I'm hoping for something that will run > my program either as scgi or cgi. > > I did find something called paste which purports to be some sort of CGI > Bridge framework but from the docume

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Ken Tilton
Ken Tilton wrote: > > I just keep what I call a "datapulse ID", sequentially growing from > zero, in a global variable. Each ruled Cell keeps track of its memoized > value, datapulse stamp, and whether it in fact changed value in reaching > its current datapulse stamp. (I can reach the curren

PyX custom x-labels

2006-05-08 Thread Ronny Mandal
Hello. I need to draw a graph, with letters on the x-axis and a numeric value on the y-axis, e.g.. a = 3, b = 6 etc. Suggestions? Thanks, Ronny Mandal -- http://mail.python.org/mailman/listinfo/python-list

Re: Using StopIteration

2006-05-08 Thread tkpmep
This is just what the doctor ordered. Thanks, as always, everyone! > By breaking out of the while loop as shown above. > > Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Thomas F. Burdick
Ken Tilton <[EMAIL PROTECTED]> writes: > No, you do not want on-change handlers propagating data to other > slots, though that is a sound albeit primitive way of improving > self-consistency of data in big apps. The productivity win with > VisiCalc was that one simply writes rules that use other c

Python's DSLs (was: A critic of Guido's blog on Python's lambda)

2006-05-08 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: . . . >Of course, the choice of Python does mean that, when we really truly >need a "domain specific little language", we have to implement it as a >langu

Re: python rounding problem.

2006-05-08 Thread Grant Edwards
On 2006-05-08, Thomas Bartkus <[EMAIL PROTECTED]> wrote: >> does python support true rations, which means that 1/3 is a >> true one-third and not 0.3 rounded off at some >> arbitrary precision? > > At risk of being boring ;-) > > - Python supports both rational and irrational numbers as >

Re: utility functions within a class?

2006-05-08 Thread Scott David Daniels
John Salerno wrote: > Dennis Lee Bieber wrote: >> ... Single underscores are a convention/signal to the programmer that >> "this method/attribute" is considered "private" and should only be used >> by other methods within the class that defined it. The language does no >> enforcement of usage

Re: connect file object to standard output?

2006-05-08 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > I think there is a way to connect standard output to a > file, but I'd prefer not to do that, since I want to use plain print > statements to warn about errors in the function and have their output > appear on the screen. Thanks. > > def write_data(data,out_file="")

i don't understand this RE example from the documentation

2006-05-08 Thread John Salerno
Ok, I've been staring at this and figuring it out for a while. I'm close to getting it, but I'm confused by the examples: (?(id/name)yes-pattern|no-pattern) Will try to match with yes-pattern if the group with given id or name exists, and with no-pattern if it doesn't. |no-pattern is optional an

Re: get Windows file type

2006-05-08 Thread dwelch
BartlebyScrivener wrote: > Using Python on Windows XP, I am able to get almost all file and path > info using os.path or stat, but I don't see a way to retrieve the file > type? E.g. Microsoft Word file, HTML file, etc, the equivalent of what > is listed in the "Type" column in the Windows Explorer

Re: utility functions within a class?

2006-05-08 Thread John Salerno
Scott David Daniels wrote: > John Salerno wrote: >> Dennis Lee Bieber wrote: >>> ... Single underscores are a convention/signal to the programmer that >>> "this method/attribute" is considered "private" and should only be used >>> by other methods within the class that defined it. The language do

Re: i don't understand this RE example from the documentation

2006-05-08 Thread John Salerno
John Salerno wrote: > Ok, I've been staring at this and figuring it out for a while. I'm close > to getting it, but I'm confused by the examples: > > (?(id/name)yes-pattern|no-pattern) > Will try to match with yes-pattern if the group with given id or name > exists, and with no-pattern if it doe

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Patrick May
[EMAIL PROTECTED] (Alex Martelli) writes: > ...an alleged reply to me, which in fact quotes (and responds to) > only to statements by Brian, without mentioning Brian... > > Mr May, it seems that you're badly confused regarding Usenet's > quoting conventions. It seems that someone pisses in yo

Re: Getting HTTP responses - a python linkchecking script.

2006-05-08 Thread p-d-p=pas-de-spam
[EMAIL PROTECTED] a écrit : > Hi Folks, > > I'm thinking about writing a script that can be run over a whole site > and produce a report about broken links etc... > > I've been playing with the urllib2 and httplib modules as a starting > point and have found that with urllib2 it doesn't seem poss

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Ken Tilton
Thomas F. Burdick wrote: > Ken Tilton <[EMAIL PROTECTED]> writes: > > >>No, you do not want on-change handlers propagating data to other >>slots, though that is a sound albeit primitive way of improving >>self-consistency of data in big apps. The productivity win with >>VisiCalc was that one si

Re: python rounding problem.

2006-05-08 Thread Thomas Bartkus
"Grant Edwards" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2006-05-08, Thomas Bartkus <[EMAIL PROTECTED]> wrote: > > >> does python support true rations, which means that 1/3 is a > >> true one-third and not 0.3 rounded off at some > >> arbitrary precision? > > > > At

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread David C.Ullrich
On 08 May 2006 12:53:09 -0700, [EMAIL PROTECTED] (Thomas F. Burdick) wrote: >Ken Tilton <[EMAIL PROTECTED]> writes: > >> No, you do not want on-change handlers propagating data to other >> slots, though that is a sound albeit primitive way of improving >> self-consistency of data in big apps. The

Re: hyperthreading locks up sleeping threads

2006-05-08 Thread Tim Peters
[EMAIL PROTECTED] > Below are 2 files. The first is a Python program that isolates the > problem within less than 1 hour (often just a few minutes). It does not on my box. I ran that program, from a DOS shell, using the released Windows Python 2.4.3. After an hour, it was still printing. I lef

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Kaz Kylheku
Steve R. Hastings wrote: > On Fri, 05 May 2006 21:16:50 -0400, Ken Tilton wrote: > > The upshot of > > what he wrote is that it would be really hard to make semantically > > meaningful indentation work with lambda. > > Pretty much correct. The complete thought was that it would be painful > all o

Re: python rounding problem.

2006-05-08 Thread Grant Edwards
On 2006-05-08, Thomas Bartkus <[EMAIL PROTECTED]> wrote: >> Or you can write 0.1 >> 3 >> >> :) > > Ahhh! > > But if I need to store the value 1/10 (decimal!), what kind of > a precision pickle will I then find myself while working in > base 3? Then we're right back where we

Re: List Ctrl

2006-05-08 Thread Philippe Martin
[EMAIL PROTECTED] wrote: > > Hello together !! > > I have programmed a List Control and I introduced information in several > rows. What I want to do is, modify this information when i select a row > and press a button. > There two options: > - when i do this, a window appears and asks me to

logging module: add client_addr to all log records

2006-05-08 Thread [EMAIL PROTECTED]
Hi! I'm writing a server and I want to use the logging module for logging stuff. I want to log all transactions in detail, and if everything goes haywire I want to know which client did it. Therefore I want to affix the client address to every single log item. I would like to do the following: Fo

RE: Using time.sleep() in 2 threads causes lockup whenhyper-threading is enabled

2006-05-08 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: > I am a bit surprised that nobody else has tried running the short > Python program above on a hyper-threading or dual core / dual > processor system. Does it happen every time? Have you tried it on multiple machines? Is it possible that that one machine is having proble

Re: hyperthreading locks up sleeping threads

2006-05-08 Thread OlafMeding
Tim Many thanks for trying and reporting the details of your environment. All our hyper-threading PC are identical. However, we identified one that is different and we are installing Windows XP on it now ... My hope is that other people will try this, too. Olaf -- http://mail.python.org/mailm

Econometrics in Panel data?

2006-05-08 Thread DeepBlue
Hi all, I am new to Python. Just wondering can Python able to do econometric regression in either Time-series or pooled (panel) data? As well as test for hetero, autocorrelation, or endogeneity? Thank you! -- http://mail.python.org/mailman/listinfo/python-list

Global utility module/package

2006-05-08 Thread Christoph Haas
Evening, I'm currently working on a larger Python project that consists of multiple programs and packages. As I need a few utility functions time and again I moved them all into a Utility package and created a class there. Like this: Util.py: class Util: def __init__(self, debugFlag=F

Re: Global utility module/package

2006-05-08 Thread Scott David Daniels
Christoph Haas wrote: > As I know that importing packages from multiple modules always keeps it a > singleton I thought of something like this: > > Util.py: > > debugFlag = False > vibranceLevel = 'good' > > def function1(): >global debugFlag >print debugFlag The global line is

Re: hyperthreading locks up sleeping threads

2006-05-08 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > Tried importing win32api instead of time and using the > win32api.GetTickCount() and win32api.Sleep() methods. What about win32api.SleepEx? What about WaitForMultipleObjects WaitForMultipleObjectsEx WaitForSingleObject WaitForSingleObjectEx when the object is not expe

Re: Using time.sleep() in 2 threads causes lockup whenhyper-threading is enabled

2006-05-08 Thread Serge Orlov
Delaney, Timothy (Tim) wrote: > [EMAIL PROTECTED] wrote: > > > I am a bit surprised that nobody else has tried running the short > > Python program above on a hyper-threading or dual core / dual > > processor system. > > Does it happen every time? Have you tried it on multiple machines? Is it > po

Re: Econometrics in Panel data?

2006-05-08 Thread beliavsky
DeepBlue wrote: > Hi all, > > I am new to Python. Just wondering can Python able to do econometric > regression in either Time-series or pooled (panel) data? As well as test > for hetero, autocorrelation, or endogeneity? > Thank you! NumPy can do linear regression, and one can certainly program a

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Ken Tilton
David C. Ullrich wrote: > On 08 May 2006 12:53:09 -0700, [EMAIL PROTECTED] (Thomas > F. Burdick) wrote: > > >>Ken Tilton <[EMAIL PROTECTED]> writes: >> >> >>>No, you do not want on-change handlers propagating data to other >>>slots, though that is a sound albeit primitive way of improving >>>se

Re: advanced number recognition in strings?

2006-05-08 Thread Heiko Wundram
Am Montag 08 Mai 2006 19:03 schrieb [EMAIL PROTECTED]: > we want extract numbers from strings and wonder if there is already a > module around for doing this. An example in our case would look like > this: > > 0.032 +/- 0.5 x 10(-4) Should work beautifully with the re.finditer function (untested!)

Dr. Dobb's Python-URL! - weekly Python news and links (May 8)

2006-05-08 Thread Peter Otten
QOTW: "If you can find a workable solution not involving metaclasses and decorators, don't use them" - Michele Simionato "Newest Beautiful Soup beta solves everyone's problems that I know of." - Leonard Richardson Jeff Croft gives a good introduction to the Django web framework. Don't le

Re: i don't understand this RE example from the documentation

2006-05-08 Thread Ben Cartwright
John Salerno wrote: > John Salerno wrote: > > Ok, I've been staring at this and figuring it out for a while. I'm close > > to getting it, but I'm confused by the examples: > > > > (?(id/name)yes-pattern|no-pattern) > > Will try to match with yes-pattern if the group with given id or name > > exists

group for pure startups...

2006-05-08 Thread bruce
hi... can someone tell me if there's a group where people who are interested in starting/contributing to embryoninc startup concepts can get together/meet, exchange ideas, etc... i'm not referring to meetings where you do VC/Funding presentations, I'm basically talking about meetings where you co

Re: utility functions within a class?

2006-05-08 Thread Scott David Daniels
John Salerno wrote: > Scott David Daniels wrote: >> John Salerno wrote: >>> ... But isn't there something about a single leading underscore >>> that doesn't import when you use from X import *? Or am I thinking of >>> something else? Is that also the double underscore? >> >> That has to do with m

ascii to latin1

2006-05-08 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I'm developing a django based intranet web server that has a search page. Data contained in the database is mixed. Some of the words are accented, some are not but they should be. This is because the collection of data began a long time ago wh

Multi-line lambda proposal.

2006-05-08 Thread Kaz Kylheku
I've been reading the recent cross-posted flamewar, and read Guido's article where he posits that embedding multi-line lambdas in expressions is an unsolvable puzzle. So for the last 15 minutes I applied myself to this problem and come up with this off-the-wall proposal for you people. Perhaps thi

Re: ascii to latin1

2006-05-08 Thread Robert Kern
Luis P. Mendes wrote: > example: > if the word searched is 'televisão', I want that a search by either > 'televisao', 'televisão' or even 'télévisao' (this last one doesn't > exist in Portuguese) is successful. The ICU library has the capability to transliterate strings via certain rulesets. One

Re: ascii to latin1

2006-05-08 Thread Rene Pijlman
Luis P. Mendes: >I'm developing a django based intranet web server that has a search page. > >Data contained in the database is mixed. Some of the words are >accented, some are not but they should be. This is because the >collection of data began a long time ago when ascii was the only way to go

Re: group for pure startups...

2006-05-08 Thread Scott David Daniels
bruce wrote: > can someone tell me if there's a group where people who are interested in > starting/contributing to embryoninc startup concepts can get together/meet, > exchange ideas, etc... > i'm not referring to meetings where you do VC/Funding presentations, I'm > basically talking about meetin

Re: Multi-line lambda proposal.

2006-05-08 Thread Scott David Daniels
Kaz Kylheku wrote: > I've been reading the recent cross-posted flamewar, and read Guido's > article where he posits that embedding multi-line lambdas in > expressions is an unsolvable puzzle. > > So for the last 15 minutes I applied myself to this problem and come up > with this off-the-wall propo

Re: ascii to latin1

2006-05-08 Thread Serge Orlov
Luis P. Mendes wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > I'm developing a django based intranet web server that has a search page. > > Data contained in the database is mixed. Some of the words are > accented, some are not but they should be. This is because the > colle

Re: Multi-line lambda proposal.

2006-05-08 Thread Leif K-Brooks
Kaz Kylheku wrote: > But suppose that the expression and the multi-line lambda body are > reordered? That is to say, the expression is written normally, and the > mlambda expressions in it serve as /markers/ indicating that body > material follows. This results in the most Python-like solution. I

__dict__ in class inherited from C extension module

2006-05-08 Thread Tamas Nepusz
Dear Python experts, I have a strange problem - or more precisely, I'm not even sure if it's a problem or not. I'm developing a Python extension module in C which creates a new type with methods, mapping support and stuff like that :) Everything's working fine, but if I inherit a new class from th

Memory leak in Python

2006-05-08 Thread diffuser78
I have a python code which is running on a huge data set. After starting the program the computer becomes unstable and gets very diffucult to even open konsole to kill that process. What I am assuming is that I am running out of memory. What should I do to make sure that my code runs fine without

Re: advanced number recognition in strings?

2006-05-08 Thread skip
Sebastian> we want extract numbers from strings and wonder if there is Sebastian> already a module around for doing this. An example in our Sebastian> case would look like this: Sebastian> 0.032 +/- 0.5 x 10(-4) Sebastian> it would even be helpful to have a routine which does

Re: Why list.sort() don't return the list reference instead of None?

2006-05-08 Thread [EMAIL PROTECTED]
Thank you! I got it. -- http://mail.python.org/mailman/listinfo/python-list

Re: get Windows file type

2006-05-08 Thread Roger Upole
If you have pywin32 installed, you can use the shell module. from win32com.shell import shell, shellcon shell.SHGetFileInfo(filename ,0, shellcon.SHGFI_TYPENAME) Roger "BartlebyScrivener" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Using Python on Windows XP, I am able to

Re: Memory leak in Python

2006-05-08 Thread compromise
Can you paste an example of the code you're using? -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory leak in Python

2006-05-08 Thread vbgunz
how big is the set? 100MB, more? what are you doing with the set? do you have a small example that can prove the set is causing the freeze? I am not the sharpest tool in the shed but it sounds like you might be multiplying your set in/directly either permanently or temporarily on purpose or acciden

Re: which is better, string concatentation or substitution?

2006-05-08 Thread Casey Hawthorne
[EMAIL PROTECTED] (Roy Smith) wrote: >O(n^0), which is almost always written as O(1). This is a "constant >time" algorithm, one which takes the same amount of steps to execute >no matter how big the input is. For example, in python, you can >write, "x = 'foo'". That assignment statement takes t

Re: Why list.sort() don't return the list reference instead of None?

2006-05-08 Thread vbgunz
to throw fire on the fuel (:P), you can get the value back to an in-place mutable change with a single expression... mylist = [2,3,4,1] print mylist.sort() or mylist might not be too pythonic or maybe it is. I guess depends on what side of the glass you might wish to view the solution :) -- htt

Re: which is better, string concatentation or substitution?

2006-05-08 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Casey Hawthorne <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] (Roy Smith) wrote: > > >O(n^0), which is almost always written as O(1). This is a "constant > >time" algorithm, one which takes the same amount of steps to execute > >no matter how big the input is.

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Alex Martelli
Joe Marshall <[EMAIL PROTECTED]> wrote: ... > If you language allows unnamed integers, unnamed strings, unnamed > characters, unnamed arrays or aggregates, unnamed floats, unnamed > expressions, unnamed statements, unnamed argument lists, etc. why > *require* a name for trivial functions? I th

Enumerating Regular Expressions

2006-05-08 Thread blair . bethwaite
Hi all, Does anybody know of a module that allows you to enumerate all the strings a particular regular expression describes? Cheers, -Blair -- http://mail.python.org/mailman/listinfo/python-list

Re: Enumerating Regular Expressions

2006-05-08 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hi all, > > Does anybody know of a module that allows you to enumerate all the > strings a particular regular expression describes? > > Cheers, > -Blair > You mean like re.compile(r'.*') ? -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 L

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Pisin Bootvong
Joe Marshall wrote: > Alex Martelli wrote: > Most languages allow `unnamed numbers'. The `VAT_MULTIPLIER' argument > is a > strawman. Would you want to have to use a special syntax to name the > increment > in loop? > > defnumber zero 0 > defnumber one { successor (zero); } > > for (int i = z

Re: Enumerating Regular Expressions

2006-05-08 Thread blair . bethwaite
James Stroud wrote: > You mean like re.compile(r'.*') ? No. I mean like: >>> regex = re.compile(r'a|b') >>> regex.enumerate() a b >>> -- http://mail.python.org/mailman/listinfo/python-list

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Ken Tilton
Pisin Bootvong wrote: > Joe Marshall wrote: > >>Alex Martelli wrote: >>Most languages allow `unnamed numbers'. The `VAT_MULTIPLIER' argument >>is a >>strawman. Would you want to have to use a special syntax to name the >>increment >>in loop? >> >> defnumber zero 0 >> defnumber one { successor

Re: Enumerating Regular Expressions

2006-05-08 Thread James Stroud
[EMAIL PROTECTED] wrote: > James Stroud wrote: > >>You mean like re.compile(r'.*') ? > > > No. I mean like: > regex = re.compile(r'a|b') regex.enumerate() > > a > b > > You see the difficulty don't you? How will the computer know in advance that the regex matches only a finite set

Re: Memory leak in Python

2006-05-08 Thread diffuser78
Its kinda 65o lines of code...not the best idea to paste the code. [EMAIL PROTECTED] wrote: > Can you paste an example of the code you're using? -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   >