Re: Finding Peoples' Names in Files

2007-10-11 Thread Matimus
On Oct 11, 9:11 am, brad <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > However...how can you know it is a name... > > OK, I admitted in my first post that it was a crazy question, but if one > could find an answer, one would be onto something. Maybe it's not a 100% > answerable question

how to get the NT event log properties with OnObjectReady() with python

2007-10-11 Thread [EMAIL PROTECTED]
I'm trying to get a notification from the NT event for any new event using the DispatchWithEvents() function. Everything seems to be working the way I wanted, but I don't know how to get the properties of the event (ie. event type, message, etc.) from the OnObjectReady() callback. class SinkClass(

how to get the NT event log properties with OnObjectReady() with python

2007-10-11 Thread [EMAIL PROTECTED]
I'm trying to get a notification from the NT event for any new event using the DispatchWithEvents() function. Everything seems to be working the way I wanted, but I don't know how to get the properties of the event (ie. event type, message, etc.) from the OnObjectReady() callback. class SinkClass(

Re: Advice on long running processes

2007-10-11 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hello, > > I write a lot of CGI scripts, in Python of course. Now I need to > convert some to long-running processes. I'm having trouble finding > resources about the best practices to do that. > > I've found a lot of email discussions that say something like, "You

Re: Declarative properties

2007-10-11 Thread Marc 'BlackJack' Rintsch
On Thu, 11 Oct 2007 15:39:29 +, Artur Siekielski wrote: > On Oct 11, 4:21 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> > 2. Properties define (a part of) public interface of a class. When >> > using fields for public access, you must tell this explicitly in >> > documentation, or use

Re: Fwd: NUCULAR fielded text searchable indexing

2007-10-11 Thread Paul Rubin
[EMAIL PROTECTED] writes: > > ...but it looks a little more akin to Solr than to Lucene. ... > > I'm not sure but I think nucular has aspects of both since > it implements both the search engine itself and also provides > XML and HTTP interfaces That sounds reasonable. > As a test I built an in

Re: storing meta data on dictionary keys

2007-10-11 Thread Andreas Kraemer
> > [...]In fact, now that I think of it, get_key > > is probably a bad name for it, get_other_object_with_this_same_key is > > probably more apt :) > > Or more precise: > get_key_that_was_used_when_value_was_inserted_into_dictionary :-) Or even more precisely: get_key_obj

Re: Problem of Readability of Python

2007-10-11 Thread Bjoern Schliessmann
Steven Bethard wrote: > Actually, your posting just used dicts normally. > > Kevin is creating a prototype dict with a certain set of keys, and > then copying that dict and filling in the keys each time he > creates a new instance. It's basically a poor man's OOP. And operatively, IMHO, there is

Re: I'm starting to think like a Pythonista

2007-10-11 Thread Bjoern Schliessmann
brad wrote: > Bjoern Schliessmann wrote: >> Why use xrange if you convert it to a full list in place? No >> advantage there. > > What is the dis-advantage of using xrange over range in this > circumstance? Hardly any, but honestly: Converting it to a list manually is more than superfluous. Rega

Re: Finding Peoples' Names in Files

2007-10-11 Thread brad
[EMAIL PROTECTED] wrote: > However...how can you know it is a name... OK, I admitted in my first post that it was a crazy question, but if one could find an answer, one would be onto something. Maybe it's not a 100% answerable question, but I would guess that it is an 80% answerable question..

Re: Problems with struct.pack()

2007-10-11 Thread Carsten Haese
On Thu, 2007-10-11 at 10:45 -0500, Robert Dailey wrote: > What if 'mystring' has been encoded to "utf-8"? > > mystring = u"Hello World" > mystring = mystring.encode( "utf-8" ) > > So far the code above doesn't seem to work with this. Why would you encode the string into UTF-8? Didn't you say tha

Re: Script to Remove Attachments in Exchange Mailbox

2007-10-11 Thread KDawg44
On Oct 11, 10:03 am, Tim Golden <[EMAIL PROTECTED]> wrote: > KDawg44 wrote: > > Hi, > > > I am frustrated with my users who send large files around the office > > instead of using the network shares. > > [...] > > > Which means that there are 8 copies of the same file 4MB taking up > > space, or a

Re: Finding Peoples' Names in Files

2007-10-11 Thread Francesco Guerrieri
On 10/11/07, brad <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Oct 11, 5:22 pm, brad <[EMAIL PROTECTED]> wrote: > >> Crazy question, but has anyone attempted this or seen Python code that > >> does? For example, if a text file contained 'Guido' and or 'Robert' and > >> or 'Susan', t

Re: Finding Peoples' Names in Files

2007-10-11 Thread cokofreedom
On Oct 11, 5:40 pm, brad <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Oct 11, 5:22 pm, brad <[EMAIL PROTECTED]> wrote: > >> Crazy question, but has anyone attempted this or seen Python code that > >> does? For example, if a text file contained 'Guido' and or 'Robert' and > >> or 'Su

Re: Finding Peoples' Names in Files

2007-10-11 Thread Diez B. Roggisch
brad wrote: > [EMAIL PROTECTED] wrote: >> On Oct 11, 5:22 pm, brad <[EMAIL PROTECTED]> wrote: >>> Crazy question, but has anyone attempted this or seen Python code that >>> does? For example, if a text file contained 'Guido' and or 'Robert' and >>> or 'Susan', then we should return True, otherwise

RE: RMI with Pyro et al -- thanks for help

2007-10-11 Thread Sells, Fred
thanks, that should do it Diez wrote: > Go install cygwin (but not it's included python-interpreter, > or at least > make sure you have your python path properly under control) > and then simply > start the script from the command-line. And hit C-c if you > need it to stop, > and restart it. On

Re: Problems with struct.pack()

2007-10-11 Thread Robert Dailey
On 10/11/07, Carsten Haese <[EMAIL PROTECTED]> wrote: > > This is much clearer, and it explains why you need to mix arbitrary binary > data with unicode text. Because of this mixing, as you have surmised, > you're > going to have to treat the file as a binary file in Python. In other > words, > don

Re: Finding Peoples' Names in Files

2007-10-11 Thread brad
[EMAIL PROTECTED] wrote: > On Oct 11, 5:22 pm, brad <[EMAIL PROTECTED]> wrote: >> Crazy question, but has anyone attempted this or seen Python code that >> does? For example, if a text file contained 'Guido' and or 'Robert' and >> or 'Susan', then we should return True, otherwise return False. > >

Re: Declarative properties

2007-10-11 Thread Artur Siekielski
On Oct 11, 4:21 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > In practice, it turns out to be a lot less work to deal with that > occasionally than to always deal with lugging around internal > attributes and external properties when they're really not needed. By > writing everything as pro

a good website for softwares,sports,movies and music ,sex etc.

2007-10-11 Thread panguohua
www.space666.com good -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding Peoples' Names in Files

2007-10-11 Thread Tim Williams
On 11/10/2007, brad <[EMAIL PROTECTED]> wrote: > Crazy question, but has anyone attempted this or seen Python code that > does? For example, if a text file contained 'Guido' and or 'Robert' and > or 'Susan', then we should return True, otherwise return False. > -- > http://mail.python.org/mailman/l

Re: Finding Peoples' Names in Files

2007-10-11 Thread cokofreedom
On Oct 11, 5:22 pm, brad <[EMAIL PROTECTED]> wrote: > Crazy question, but has anyone attempted this or seen Python code that > does? For example, if a text file contained 'Guido' and or 'Robert' and > or 'Susan', then we should return True, otherwise return False. Can't you just use the string fun

Finding Peoples' Names in Files

2007-10-11 Thread brad
Crazy question, but has anyone attempted this or seen Python code that does? For example, if a text file contained 'Guido' and or 'Robert' and or 'Susan', then we should return True, otherwise return False. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python module for making Quicktime or mpeg movies from images

2007-10-11 Thread Tim Golden
jeremito wrote: > On Oct 11, 10:43 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> jeremito wrote: >>> My Python script makes a bunch of images that I want to use as frames >>> in a movie. I've tried searching for a module that will take these >>> images and put them together in a Quicktime o

where to put application-specific data files?

2007-10-11 Thread Brian Blais
Hello, I am developing an application that needs some data files, but I am not sure what the best way to package and access them. For instance, I have module like: mymodule/ __init__.py run.py data/ file1.dat file2.dat In run.py, I can do something like: fname='da

Re: Advice on long running processes

2007-10-11 Thread Bruno Barberi Gnecco
Roy Smith wrote: > [EMAIL PROTECTED] wrote: > > >>Hello, >> >>I write a lot of CGI scripts, in Python of course. Now I need to >>convert some to long-running processes. I'm having trouble finding >>resources about the best practices to do that. >> >>I've found a lot of email discussions that sa

Re: Python module for making Quicktime or mpeg movies from images

2007-10-11 Thread jeremito
On Oct 11, 10:43 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > jeremito wrote: > > My Python script makes a bunch of images that I want to use as frames > > in a movie. I've tried searching for a module that will take these > > images and put them together in a Quicktime or mpeg movie, but h

Re: RuntimeWarning: tp_compare

2007-10-11 Thread Bruno Barberi Gnecco
Chris Mellon wrote: > On 10/9/07, Bruno Barberi Gnecco > <[EMAIL PROTECTED]> wrote: > >>I'm getting the following exception when I call an external extension >>(pytst): >> >>/usr/lib/python2.5/threading.py:697: RuntimeWarning: tp_compare didn't return >>-1 or -2 for >>exception >> retur

Re: Script to Remove Attachments in Exchange Mailbox

2007-10-11 Thread Tim Golden
KDawg44 wrote: > Hi, > > I am frustrated with my users who send large files around the office > instead of using the network shares. [...] > Which means that there are 8 copies of the same file 4MB taking up > space, or a 4MB file turned into a 32MB file." > > So, what I would like, is to write

Re: PYTHONPATH on OS X

2007-10-11 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
On Oct 10, 4:59 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Oct 11, 8:00 am, "mhearne808[insert-at-sign-here]gmail[insert-dot- > > > > here]com" <[EMAIL PROTECTED]> wrote: > > I'm missing something major here. I'm trying to add a directory to my > > python path using the PYTHONPATH enviro

Re: Advice on long running processes

2007-10-11 Thread Roy Smith
[EMAIL PROTECTED] wrote: > Hello, > > I write a lot of CGI scripts, in Python of course. Now I need to > convert some to long-running processes. I'm having trouble finding > resources about the best practices to do that. > > I've found a lot of email discussions that say something like, "You >

Re: Python module for making Quicktime or mpeg movies from images

2007-10-11 Thread Diez B. Roggisch
jeremito wrote: > My Python script makes a bunch of images that I want to use as frames > in a movie. I've tried searching for a module that will take these > images and put them together in a Quicktime or mpeg movie, but haven't > found anything. My images are currently pdfs, but I could make t

Python module for making Quicktime or mpeg movies from images

2007-10-11 Thread jeremito
My Python script makes a bunch of images that I want to use as frames in a movie. I've tried searching for a module that will take these images and put them together in a Quicktime or mpeg movie, but haven't found anything. My images are currently pdfs, but I could make them into just about anyth

Re: Cannibals For The Presidency! Meet, The Candidates!

2007-10-11 Thread Josh Hill
On Thu, 11 Oct 2007 07:10:41 -0700, [EMAIL PROTECTED] wrote: >Introducing The Dhourties And The Dualdigers, Nudism? Nakedity? Aren't >We Born Naked? Isn't Our Naked Skin Our Clothes? Is Being Born Naked A >Crime By The Dhourties' Logic If Nudity In Public Is A Crime? Sanest post I've seen here al

Advice on long running processes

2007-10-11 Thread commander_coder
Hello, I write a lot of CGI scripts, in Python of course. Now I need to convert some to long-running processes. I'm having trouble finding resources about the best practices to do that. I've found a lot of email discussions that say something like, "You need to educate yourself about the differ

Re: EasyMock for python ?

2007-10-11 Thread Simon Brunning
On 10/10/07, BlueBird <[EMAIL PROTECTED]> wrote: > Does anybody know where to find a library like EasyMock for python ? I > searched quickly but could not find anything. > > I found python-mocks on sourceforge but form quickly reading the docs, > it is not an EasyMock style mock. Actually, accordin

Re: Declarative properties

2007-10-11 Thread [EMAIL PROTECTED]
Artur Siekielski wrote: > On Oct 11, 2:27 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > But why? Default getters and setters are unnecessary and if you need > > something other than the default you need to write it anyway more > > explicitly. > > I see some problems with your approac

Python process automatically restarting itself

2007-10-11 Thread Adam Atlas
What is the best way for a Python process (presumed to be a script run by the interpreter binary, not embedded in some other program) to restart itself? This is what I've been trying: import __main__ for path in sys.path: path += '/' + __main__.__file__ if os.access(path,

Re: PyDev 1.3.9 code compleition trouble

2007-10-11 Thread Don Taylor
Vyacheslav Maslov wrote: > I use Pydev 1.3.9 and notice issue related to code completion. I give an > ...stuff deleted... > proposed also as well. Why this doesn't work? You will have better luck asking this question on the Pydev forum: http://sourceforge.net/forum/forum.php?forum_id=293649 Th

RE: RMI with Pyro et al

2007-10-11 Thread Diez B. Roggisch
Sells, Fred wrote: > Diez B. Roggisch wrote > . Why do you want that (hot deploy) >> anyway? Does startuptime of a script really bother you? >> shouldn't take >> more than a few seconds. > > My primary need is development/debug. I'm a Pyro newbie and I add a > feature and then test. The only wa

Re: "".join(string_generator()) fails to be magic

2007-10-11 Thread Sion Arrowsmith
Matt Mackal <[EMAIL PROTECTED]> wrote: >I have an application that occassionally is called upon to process >strings that are a substantial portion of the size of memory. For >various reasons, the resultant strings must fit completely in RAM. Do you mean physical RAM, or addressable memory? If the

Re: matching a street address with regular expressions

2007-10-11 Thread Andy Cheesman
Check out kodos http://kodos.sourceforge.net/ for an interactive python regexp tester Andy Goldfish wrote: > Don't forget to write test cases. If you have a series of addresses, > and confirm they are parsed correctly, you are in a good position to > refine the pattern. You will instantly know if

Re: Declarative properties

2007-10-11 Thread Marc 'BlackJack' Rintsch
On Thu, 11 Oct 2007 13:04:53 +, Artur Siekielski wrote: > On Oct 11, 2:27 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> But why? Default getters and setters are unnecessary and if you need >> something other than the default you need to write it anyway more >> explicitly. > > I

Re: gdbm troubles.

2007-10-11 Thread Laszlo Nagy
Shriphani wrote: > dictionary = gdbm.open('dictionary','c') > dictionary['Ellipsize'] = 'Openbox' > dictionary.get('Ellipsize') > Try this: print dictionary['Ellipsize'] del dictionary['Ellipsize'] gdbm objects are similar to builtin dictionaries. By the way, they are not iterable, but they

Script to Remove Attachments in Exchange Mailbox

2007-10-11 Thread KDawg44
Hi, I am frustrated with my users who send large files around the office instead of using the network shares. For instance, this is one of many emails I have sent around: "If you take the this kit it looks like J sent it to D, D sent it to you, then you sent it to me. The problem with that is j

Re: Problem with MySQL cursor

2007-10-11 Thread Carsten Haese
On Thu, 2007-10-11 at 15:14 +0200, Florian Lindner wrote: > Hello, > I have a function that executes a SQL statement with MySQLdb: > > def executeSQL(sql, *args): > print sql % args > cursor = conn.cursor() > cursor.execute(sql, args) > cursor.close() > > it's called like that: >

RE: Problem with MySQL cursor

2007-10-11 Thread Sells, Fred
I don't think you can substitute the table name and column names in the execute, just values ( I could be wrong) try building it like this: sql = "INSERT INTO %s %s VALUES " % (taablename, columnstuple, '(%s)') cursor.execute(sql, values) > Hello, > I have a function that executes a SQL statemen

Re: matching a street address with regular expressions

2007-10-11 Thread Goldfish
Don't forget to write test cases. If you have a series of addresses, and confirm they are parsed correctly, you are in a good position to refine the pattern. You will instantly know if a change in pattern has broken another pattern. The reason I'm saying this, is because I think your pattern is in

Re: Problem with MySQL cursor

2007-10-11 Thread J. Clifford Dyer
On Thu, Oct 11, 2007 at 03:14:30PM +0200, Florian Lindner wrote regarding Problem with MySQL cursor: > > Traceback (most recent call last): > File "manage.py", line 90, in ? > addDomain(domainName) > File "manage.py", line 27, in addDomain > executeSQL(sql, DOMAIN_TABLE, DOMAIN_FIELD

Re: Fwd: NUCULAR fielded text searchable indexing

2007-10-11 Thread aaron . watters
On Oct 11, 3:30 am, Paul Rubin wrote: > "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> writes: > As for [ http://nucular.sourceforge.net ] > itself, I've only had a chance to glance at the > site... Thanks for taking a look. I hope you don't mind if I disagree with a numb

Problem with MySQL cursor

2007-10-11 Thread Florian Lindner
Hello, I have a function that executes a SQL statement with MySQLdb: def executeSQL(sql, *args): print sql % args cursor = conn.cursor() cursor.execute(sql, args) cursor.close() it's called like that: sql = "INSERT INTO %s (%s) VALUES (%s)" executeSQL(sql, DOMAIN_TABLE,

RE: RMI with Pyro et al

2007-10-11 Thread Sells, Fred
Diez B. Roggisch wrote . Why do you want that (hot deploy) > anyway? Does startuptime of a script really bother you? > shouldn't take > more than a few seconds. My primary need is development/debug. I'm a Pyro newbie and I add a feature and then test. The only way I've found to kill the Pyro

Re: Declarative properties

2007-10-11 Thread Artur Siekielski
On Oct 11, 2:27 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > But why? Default getters and setters are unnecessary and if you need > something other than the default you need to write it anyway more > explicitly. I see some problems with your approach: 1. If I use instance field 'nam

Re: Duck Typing and **kwds

2007-10-11 Thread Eduardo O. Padoan
On 10/11/07, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > > Hi there. > > I just tried this test: > > > def f(**kwds): > print kwds > > import UserDict > d = UserDict.UserDict(hello="world") > f(**d) > > > And it fails with a TypeError exception ("f() argument after ** must be a > di

Re: Declarative properties

2007-10-11 Thread Marc 'BlackJack' Rintsch
On Thu, 11 Oct 2007 11:48:18 +, Artur Siekielski wrote: > class Person(object): >def __init__(self, name): > self._name = name >def _get_name(self): > return self._name >def _set_name(self, new_name): > self._name = new_name >name = property(_get_name, _set_na

Re: gdbm troubles.

2007-10-11 Thread Marc 'BlackJack' Rintsch
On Thu, 11 Oct 2007 11:49:05 +, Shriphani wrote: > dictionary = gdbm.open('dictionary','c') > dictionary['Ellipsize'] = 'Openbox' > dictionary.get('Ellipsize') > > the last line generates an attribute error. Can someone tell me what I > am doing wrong? You are trying to use a method that doe

Re: Accessing Function Variables from Sub-functions

2007-10-11 Thread Diez B. Roggisch
Licheng Fang wrote: > On Apr 14 2003, 10:30 pm, Alex Martelli <[EMAIL PROTECTED]> wrote: >> Sebastian Wilhelmi wrote: >> > Hi, >> >> > I would like to do the following: >> >> > ---8<---8<---8<---8<--- >> > def test (): >> > count = 0 >> > def inc_count (): >> >

Re: Is hostmonster any good for hosting python?

2007-10-11 Thread Tim Chase
>> According to hostmonster's list of features, they do support python. >> Does anybody have any experience with hostmonster? > > I'm using host monster to run my html-only site. However, I want to > add some python cgi, and I'd prefer to extend that to the Django > framework. I've had some issues

Re: Is hostmonster any good for hosting python?

2007-10-11 Thread jayharvard1
On Oct 10, 1:27 pm, walterbyrd <[EMAIL PROTECTED]> wrote: > According to hostmonster's list of features, they do support python. > Does anybody have any experience with hostmonster? I'm using host monster to run my html-only site. However, I want to add some python cgi, and I'd prefer to extend th

Re: Problems with struct.pack()

2007-10-11 Thread Carsten Haese
On Wed, 10 Oct 2007 22:19:49 -0500, Robert Dailey wrote > Hi, > > Thanks for responding. I apologize about my lack of details, I was in a hurry when I wrote the initial question. I'll provide more details. > > Basically, I'm attempting to write out unicode strings (16 bits per character) to a

gdbm troubles.

2007-10-11 Thread Shriphani
dictionary = gdbm.open('dictionary','c') dictionary['Ellipsize'] = 'Openbox' dictionary.get('Ellipsize') the last line generates an attribute error. Can someone tell me what I am doing wrong? Regards, Shriphani Palakodety -- http://mail.python.org/mailman/listinfo/python-list

Declarative properties

2007-10-11 Thread Artur Siekielski
Hi. I would like to have declarative properties in Python, ie. something like slots definitions in defclass in Common Lisp. It seems that even Java will have it, using a library ( https://bean-properties.dev.java.net/ ). I know about 'property' function in Python, but it's normal usage isn't decl

Py2exe with PyQt4 and sqlite

2007-10-11 Thread ilochab
I wrote an application that uses PyQt4 to access a sqlite DB. Now I'm trying to convert it using py2exe and I found some problems. The last one, that I'm not able to avoid, is that when I launch the application's binary on a PC (that contains only a Python 2.5 installation and no QT4) I get an err

Re: multimethods decorator

2007-10-11 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : >> Gerardo Herzig a écrit : >>> Hi all. Im reading the Gido's aproach using decorators at >>> http://www.artima.com/weblogs/viewpost.jsp?thread=101605 >>> >>> It looks good to me, but the examples shows the functionality using >>> functions. >>> Now, when i try to give t

Accessing Function Variables from Sub-functions

2007-10-11 Thread Licheng Fang
On Apr 14 2003, 10:30 pm, Alex Martelli <[EMAIL PROTECTED]> wrote: > Sebastian Wilhelmi wrote: > > Hi, > > > I would like to do the following: > > > ---8<---8<---8<---8<--- > > def test (): > > count = 0 > > def inc_count (): > > count += 1 > > inc_count () >

MSN Bot Class

2007-10-11 Thread makobu
## # MsnClient Class -- A basic class that enables one to create an MSN client this way: # x = MsnClient(to_msnid, bot_msnid, bot_msnid_password, messege); x.tell() # (C) Timothy Makobu, 2007 ##

Python SVN down?

2007-10-11 Thread Anthon
I am trying to get at the python source code, but it seems svn.python.org is down, at least on port 80 (http) and 3690 (svn). This happened earlier this week and then it came back (at least yesterday). Are all the real ( ;-) ) developers using ssh+svn and not noticing this? Anthon -- http://mai

Re: for loop question

2007-10-11 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > >> >>> pairs = (test[i:i+2] for i in xrange(len(test)-1)) > >> >>> for a,b in pairs: > >> ... print a,b > > > > for a, b in zip(test, test[1:]): > > print a, b > > May be unfortunately slow if test is half a gigabyte of data, what with > ess

Re: Keeping track of subclasses and instances?

2007-10-11 Thread Michele Simionato
On Oct 11, 7:16 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Is there a problem with writing C like this? > > class C(object): > def __init__(self): > logging.warn('Allocating resource ...') > self.__log = logging.warn > def __del__(self): > se

Re: for loop question

2007-10-11 Thread Paul Hankin
On Oct 11, 4:40 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Wed, 10 Oct 2007 20:25:00 +, Paul Hankin wrote: > >> A "works-for-me": > > >> >>> pairs = (test[i:i+2] for i in xrange(len(test)-1)) > >> >>> for a,b in pairs: > >> ... print a,b > > > for a, b in zip(

Watch TV stations from around the World

2007-10-11 Thread jbean
Even watch the War in Iraq live and uncensored from your PC or Laptop for FREE after a small onetime installment fee. 1,000's more stations. http://jblog.ipodpsp.hop.clickbank.net -- http://mail.python.org/mailman/listinfo/python-list

Re: "".join(string_generator()) fails to be magic

2007-10-11 Thread Marc 'BlackJack' Rintsch
On Thu, 11 Oct 2007 07:02:10 +, thebjorn wrote: > On Oct 11, 8:53 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> Even if `str.join()` would not convert the generator into a list first, >> you would have overallocation. You don't know the final string size >> beforehand so intermed

Re: "".join(string_generator()) fails to be magic

2007-10-11 Thread Diez B. Roggisch
Matt Mackal schrieb: > I have an application that occassionally is called upon to process > strings that are a substantial portion of the size of memory. For > various reasons, the resultant strings must fit completely in RAM. > Occassionally, I need to join some large strings to build some even >

Re: if then elif

2007-10-11 Thread Michael L Torrie
Michael L Torrie wrote: > Which is exactly what he said. Haha. Nevermind. You're right. A subtle distinction, isn't it. >He also said that what the poster > probably wanted was > > if cal <= 0 or fat <=0 > > -- http://mail.python.org/mailman/listinfo/python-list

Re: pytz has so many timezones!

2007-10-11 Thread Jerry Hill
On 10/10/07, Sanjay <[EMAIL PROTECTED]> wrote: > Thanks a lot, Guys. The immediate step I think to take is having two > combo boxes (dividing the data by '/'). Thanks for enormous response > and the valuable suggestions! The most elegant way I've seen to handle this in a graphical interface (eithe

Re: Fwd: NUCULAR fielded text searchable indexing

2007-10-11 Thread Paul Rubin
"Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> writes: > In the case of "nucular", it's a mispronunciation that has been widely > ridiculed all over the world. There are people (including myself) who so > associate it as an object of ridicule that it's an immediate turn-off. It gave me a chuckle, si

Re: Keeping track of subclasses and instances?

2007-10-11 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Is there a problem with writing C like this? > class C(object): > def __init__(self): > logging.warn('Allocating resource ...') > self.__log = logging.warn > It works for me. Have I missed something? I thought the OP wanted to the

Re: The fundamental concept of continuations

2007-10-11 Thread George Neuner
On Wed, 10 Oct 2007 12:49:58 +0200, David Kastrup <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] writes: > >> Again I am depressed to encounter a fundamentally new concept that I >> was all along unheard of. Its not even in paul graham's book where i >> learnt part of Lisp. Its in Marc Feeley's vid

Re: "".join(string_generator()) fails to be magic

2007-10-11 Thread thebjorn
On Oct 11, 8:53 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Thu, 11 Oct 2007 01:26:04 -0500, Matt Mackal wrote: > > I have an application that occassionally is called upon to process > > strings that are a substantial portion of the size of memory. For > > various reasons, the resu

<    1   2