Re: Question About When Objects Are Destroyed (continued)

2017-08-05 Thread Tim Daneliuk
On 08/04/2017 07:00 PM, Chris Angelico wrote: > Again, don't stress about exactly when objects get > disposed of; it doesn't matter. Respectfully, I disagree strongly. Objects get build on the heap and persist even when they go out of scope until such time garbage collection takes place. This i

Re: Question About When Objects Are Destroyed (continued)

2017-08-05 Thread Tim Daneliuk
On 08/05/2017 03:21 PM, Chris Angelico wrote: > After a 'with' block, > the object *still exists*, but it has been "exited" in some way > (usually by closing/releasing an underlying resource). The containing object exists, but the things that the closing logic explicitly released do not. In some

Re: Question About When Objects Are Destroyed (continued)

2017-08-05 Thread Tim Daneliuk
On 08/05/2017 11:16 AM, Ned Batchelder wrote: > It uses > reference counting, so most objects are reclaimed immediately when their > reference count goes to zero, such as at the end of local scopes. Given this code: class SomeObject: . for foo in somelist: a = SomeObject(foo) b

Re: Question About When Objects Are Destroyed (continued)

2017-08-05 Thread Tim Daneliuk
On 08/05/2017 05:58 PM, Chris Angelico wrote: > On Sun, Aug 6, 2017 at 7:32 AM, Tim Daneliuk wrote: >> On 08/05/2017 03:21 PM, Chris Angelico wrote: >>> After a 'with' block, >>> the object *still exists*, but it has been "exited" in some way

Re: Question About When Objects Are Destroyed (continued)

2017-08-05 Thread Tim Daneliuk
On 08/05/2017 05:58 PM, Chris Angelico wrote: > On Sun, Aug 6, 2017 at 7:32 AM, Tim Daneliuk wrote: >> On 08/05/2017 03:21 PM, Chris Angelico wrote: >>> After a 'with' block, >>> the object *still exists*, but it has been "exited" in some way

Re: Question About When Objects Are Destroyed (continued)

2017-08-05 Thread Tim Daneliuk
On 08/05/2017 05:36 PM, Ned Batchelder wrote: > On 8/5/17 5:41 PM, Tim Daneliuk wrote: >> On 08/05/2017 11:16 AM, Ned Batchelder wrote: >>> It uses >>> reference counting, so most objects are reclaimed immediately when their >>> reference count goes to zero

Re: Question About When Objects Are Destroyed (continued)

2017-08-05 Thread Tim Daneliuk
On 08/05/2017 05:36 PM, Ned Batchelder wrote: > On 8/5/17 5:41 PM, Tim Daneliuk wrote: >> On 08/05/2017 11:16 AM, Ned Batchelder wrote: >>> It uses >>> reference counting, so most objects are reclaimed immediately when their >>> reference count goes to zero

Re: Proposed new syntax

2017-08-10 Thread Tim Daneliuk
On 08/10/2017 09:28 AM, Steve D'Aprano wrote: > Every few years, the following syntax comes up for discussion, with some > people > saying it isn't obvious what it would do, and others disagreeing and saying > that it is obvious. So I thought I'd do an informal survey. > > What would you expect t

Re: Proposed new syntax

2017-08-12 Thread Tim Chase
On 2017-08-11 00:28, Steve D'Aprano wrote: > What would you expect this syntax to return? > > [x + 1 for x in (0, 1, 2, 999, 3, 4) while x < 5] [1, 2, 3] I would see this "while-in-a-comprehension" as a itertools.takewhile() sort of syntactic sugar: >>> [x + 1 for x in takewhile(lambda m: m < 5

Re: Proposed new syntax

2017-08-13 Thread Tim Chase
On 2017-08-14 00:36, Steve D'Aprano wrote: > Python's comprehensions are inspired by Haskell's, but we made > different choices than they did: we make the fact that a > comprehension is a loop over values explicit, rather than implicit, > and we use words instead of cryptic symbols. I keep wanting

Re: python list name in subject

2017-08-22 Thread Tim Chase
On 2017-08-22 08:21, Rick Johnson wrote: > Grant Edwards wrote: > > Abdur-Rahmaan Janhangeer wrote: > > > > > > Hi all, i am subscribed to different python lists and > > > they put their names in the subject [name] subject hence > > > i can at a glance tell which mail belongs to which list. >

Re: Express thanks

2017-08-25 Thread Tim Golden
On 21/08/2017 15:34, Hamish MacDonald wrote: I wanted to give a shout out to the wonderfully passionate contributions to python I've witnessed following this and other mailing lists over the last little bit. The level of knowledge and willingness to help I've seen are truly inspiring. Super mo

Re: Reading the documentation

2017-08-26 Thread Tim Golden
On 26/08/2017 03:22, Rick Johnson wrote: Steve D'Aprano wrote: Rustom Mody wrote: Ian wrote: "Larry Martell" wrote: 9:21 PM Rustom Mody wrote: Statement 1: Aeroplanes fly. Statement 2: Submarines swim. Are these two statements equally acceptable? [Inspired by a talk by Noam Chomsky] There

Re: Case-insensitive string equality

2017-08-31 Thread Tim Chase
On 2017-08-31 23:30, Chris Angelico wrote: > The method you proposed seems a little odd - it steps through the > strings character by character and casefolds them separately. How is > it superior to the two-line function? And it still doesn't solve any > of your other cases. It also breaks when ca

Re: Case-insensitive string equality

2017-08-31 Thread Tim Chase
On 2017-08-31 18:17, Peter Otten wrote: > A quick and dirty fix would be a naming convention: > > upcase_a = something().upper() I tend to use a "_u" suffix as my convention: something_u = something.upper() which keeps the semantics of the original variable-name while hinting at the normaliza

Re: Case-insensitive string equality

2017-08-31 Thread Tim Chase
On 2017-08-31 07:10, Steven D'Aprano wrote: > So I'd like to propose some additions to 3.7 or 3.8. Adding my "yes, a case-insensitive equality-check would be useful" with the following concerns: I'd want to have an optional parameter to take locale into consideration. E.g. "i".case_insensitiv

Re: Case-insensitive string equality

2017-08-31 Thread Tim Chase
On 2017-09-01 00:53, MRAB wrote: > What would you expect the result would be for: > >>> "\N{LATIN SMALL LIGATURE FI}".case_insensitive_find("F") 0 >>> "\N{LATIN SMALL LIGATURE FI}".case_insensitive_find("I) 0.5 >>> "\N{LATIN SMALL LIGATURE FFI}".case_insensitive_find("I) 0.6

Re: Help installing Python 2.3 on Win2K

2005-09-23 Thread Tim Williams (gmail)
le. If I try to specify the full pathname by typing: python > c:\Documents and Settings\-rest of path- I get an error message that > python can't open c:\Documents. > add these directories to a text file called python.pth in your python23 directory in the format d:\dir1\dir2

RE: A quick c.l.p netiquette question

2005-09-29 Thread Delaney, Timothy (Tim)
hile since I chuckled at code ... Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: A Moronicity of Guido van Rossum

2005-09-29 Thread Delaney, Timothy (Tim)
tlook (my work account) so I can't afford to add a specific one to trash his emails... Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: A Moronicity of Guido van Rossum

2005-09-29 Thread Delaney, Timothy (Tim)
types of spam messages to the list, but XL adds so many non-spam terms that the from field gets declared a statistical anomaly :( Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: RELEASED Python 2.4.2 (final)

2005-09-29 Thread Delaney, Timothy (Tim)
ions.html Then try running the installer you downloaded (note any errors). Also, since the packages are produced by different groups (ActiveState vs. Python.org) perhaps you should uninstall the ActiveState package first (in which case you may need to install the pywin packages). Tim Delaney -- htt

RE: Merging sorted lists/iterators/generators into one stream of values...

2005-10-06 Thread Delaney, Timothy (Tim)
data source until it is no longer the smallest element, at which time you switch to the data source with the smallest element. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: socketServer questions

2005-10-08 Thread Tim Williams (gmail)
On 07/10/05, rbt <[EMAIL PROTECTED]> wrote: > I have written a python socketServer program and I have a few questions This is a multithreaded non-blocking version of your server (not tested), with a basic attempt to hande errors. from socket import * from SocketServer import * import time, threa

Re: Send password over TCP connection

2005-10-10 Thread Tim Williams (gmail)
On 10 Oct 2005 13:31:51 -0700, dcrespo <[EMAIL PROTECTED]> wrote: > Hi. I found TSL, a Python Library that supports SRP. > Do you know where can I find a sample client and server code? Thanks > for your help. http://trevp.net/tlslite/ It comes with examples. I use it in several servers and clie

RE: TurboGears slashdotted

2005-10-10 Thread Delaney, Timothy (Tim)
Grig Gheorghiu wrote: > "TurboGears: Python on Rails?" post: > > http://developers.slashdot.org/developers/05/10/10/0650207.shtml?tid=156 Actually, since the submitter used a coral URL (.nyud.net:8090) the TurboGears site survived remarkably well. Tim Delaney -- http://mail

RE: Looking for info on Python's memory allocation

2005-10-11 Thread Delaney, Timothy (Tim)
3 >>>> I = iter(L) >>>> I > > > (it's probably not a good idea to rely on this behaviour...) Absolutely not - this has recently been discussed on python-dev, and Guido regrets that __len__ is exposed on any of the built-in iterators. This behaviour may wel

RE: Python's garbage collection was Re: Python reliability

2005-10-12 Thread Delaney, Timothy (Tim)
of implementation has been discussed on python-dev. IIRC it was decided by Guido that unless anyone wanted to implement it and show a significant performance advantage without any regressions on any platform, it wasn't worth it. Basically, put up or shut up ;) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: do cc list from smtplib

2005-10-21 Thread Tim Williams (gmail)
On 21 Oct 2005 02:34:40 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > > def email(HOST,FROM,TO,CC,SUBJECT,BODY): > import smtplib > import string, sys > body = string.join(( > "From: %s" % FROM, > "To: %s" % TO, > "CC: %s % CC, > "Subject: %s" % SUBJECT, > "", >

Re: do cc list from smtplib

2005-10-21 Thread Tim Williams (gmail)
On 21/10/05, Steve Holden <[EMAIL PROTECTED]> wrote: > > Assuming that TO and CC are single addresses it would be saner to use: > :) Assuming that the envelope TOs (inc CCs) are the same as the Header-TOs and Header-CCs Actually, I think this would be safer ! > def email(HOST,FROM,TO,CC, RECI

RE: If Statement Error (Tic Tac Toe)

2005-11-01 Thread Delaney, Timothy (Tim)
This site will help you get a useful answer: http://www.catb.org/~esr/faqs/smart-questions.html Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary that have functions with arguments

2005-11-02 Thread Tim Williams (gmail)
On 1 Nov 2005 20:02:41 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > hi > i have a dictionary defined as > > execfunc = { 'key1' : func1 } ## def __HELLO(x=' '): print 'HELLO',x def __BYE(x=' '): print 'BYE',x def __PRINT(x=None, y=None): print 'PRINT',x,y c

Re: Spambayes modifications with web services

2005-11-02 Thread Tim Williams (gmail)
On 02/11/05, Steve Holden <[EMAIL PROTECTED]> wrote: > Personally I didn't regard the reply as unhelpful, and I believe the > replier was honestly trying to get you to see that your rather naive > suggestion was most unlikely to make things better. > To the OP A tip for curing your own problem -

RE: [ x for x in xrange(10) when p(x) ]

2005-11-10 Thread Delaney, Timothy (Tim)
Colin J. Williams wrote: > Are there generally accepted guidelines on what is appropriate for the > builtin namespace? Yes. If Guido can be convinced it should be in builtins, it should be. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding through recursion

2005-11-18 Thread Tim Williams (gmail)
On 18 Nov 2005 06:30:58 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:> I still don't get it. I tried to test with x = 0 and found that to Informative print statements can help you to see and understand  the program flow, especially if the problem is conceptual,  with no *real*  errors in yo

Re: query domain registry from python?

2005-11-20 Thread Tim Williams (gmail)
On 19 Nov 2005 19:40:58 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:hi, does anyone know of a library that can query domain registry or any site that provide information to such an activity? as i want to build asimple domain name searching program for my own benefit.. thanks alot :D [TW]  

RE: Python as Guido Intended

2005-11-24 Thread Delaney, Timothy (Tim)
other languages onto it. There's nothing wrong with bringing concepts across from other languages (look at the "generators" history), but you need to understand how it will fit with python before proposing it as a new feature. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

How to find the port a server is listening on (from within the server)

2005-11-25 Thread Tim Williams (gmail)
How can I find the port a server is listening on - at the commented line in the code below. (ie  self.serving_on_port_num =  ? ) I have googled a lot. :-( -- class BaseSrvr(SocketServer.ThreadingMixIn, SocketServer.TCPServer):  

Re: [Forged?] Re: How to find the port a server is listening on (from within the server)

2005-11-25 Thread Tim Williams (gmail)
On 26/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:    If I understand correctly, you're looking for the socket methodgetsockname(), documented at http://docs.python.org/lib/socket-objects.htmlJeff Many thanks Jeff, self.server.socket.getsockname() did the trick. -- -- http://mail.py

RE: Python as Guido Intended

2005-11-27 Thread Delaney, Timothy (Tim)
t that to get maximum performance out of pyrex, it's necessary to produce very non-pythonic code. FWIW, I'm strongly in favour of Pyrex eventually becoming part of the Python distribution. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: New Ordered Dictionery to Criticise

2005-11-28 Thread Delaney, Timothy (Tim)
7;s messages on the djgpp port) but I think where it's not too arduous it's worthwhile. >From my quick scan, that's pop(). Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Making immutable instances

2005-11-30 Thread Delaney, Timothy (Tim)
Was it *really* necessary to send 4 separate emails to reply to four sections of the same email? Good netiquette is to intersperse your comments with quoted sections in a single email. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Making immutable instances

2005-12-01 Thread Delaney, Timothy (Tim)
Rick Wotnaz wrote: > Good netiquette might also suggest quoting what you're replying to, > wouldn't you think? Damn - I trimmed [EMAIL PROTECTED] instead of python-list from the To: list. I stuffed up. This one intentionally sent to python-list. Tim Delaney -- http://mail.py

Re: Constructing RFC2822 Message

2005-12-05 Thread Tim Williams (gmail)
tmail account to see what sort of headers each type has (or hasn't). Also,  you may be better off using smtplib for the sending portion,   the error types will be more informative if there is a connection or sending issue. HTH :) -- Tim Williams -- http://mail.python.org/mailman/listinfo/python-list

Re: Validating an email address

2005-12-09 Thread Tim Williams (gmail)
On 09/12/05, Ben Finney <[EMAIL PROTECTED]> wrote: The only validation you should be doing before sending the message ison the domain part. Since there are records available in DNS toverify, you can check those. Is there an MX record? Is the addressvalid? Do the mappings both way for that record ma

Re: Using print with format to stdout generates unwanted space

2005-06-20 Thread Tim Williams (gmail)
On 6/20/05, Michael Hoffman <[EMAIL PROTECTED]> wrote: > Paul Watson wrote: > > > While printf() does tightly control formatting in C, it does not in > > Python. > > There is no printf() in Python. You should not think of print as being a > Python version of printf. For quick and simple removal

RE: Thoughts on Guido's ITC audio interview

2005-06-27 Thread Delaney, Timothy (Tim)
process. And it allowed me to use the entire screen for editing if I wished whilst still having everything readily available. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Python & firewall control (Win32)

2005-06-27 Thread Tim Williams (gmail)
On 6/17/05, Tim Williams <[EMAIL PROTECTED]> wrote: > > > - Original Message - > > From: "Tom Anderson" <[EMAIL PROTECTED]> > > > re: http://wipfw.sourceforge.net/?page=home > > Tom, this looks good. I had it downloaded, installe

Re: Plain text email?

2005-06-27 Thread Tim Williams (gmail)
On 27 Jun 2005 15:38:59 -0700, Inkiniteo <[EMAIL PROTECTED]> wrote: > Hi guys. I have a script that sends the info by email, but i'd like to > avoid the convertion to HTML by the email client or Gmail, because it > ruins all the formatting i did (with tabs, mostly). Briefing, i wanna > be able to s

Re: Dictionary to tuple

2005-06-28 Thread Tim Williams (gmail)
On 28 Jun 2005 14:45:19 GMT, Odd-R. <[EMAIL PROTECTED]> wrote: > I have a dictionary, and I want to convert it to a tuple, > that is, I want each key - value pair in the dictionary > to be a tuple in a tuple. > > If this is the dictionary {1:'one',2:'two',3:'three'}, > then I want this to be the r

Re: POP3 and "seen" flag

2005-06-30 Thread Tim Williams (gmail)
> > > Hello All, > > Is there a way to know in a POP session of a message was seen (old) or not > (new)? > You have to keep a persistant local list of viewed messages , UID into a text file is often the simplest method. HTH :) -- http://mail.python.org/mailman/listinfo/python-list

RE: When someone from Britain speaks, Americans hear a "Britishaccent"...

2005-06-30 Thread Delaney, Timothy (Tim)
Tom Anderson wrote: > How about carrier? Ends in an "a" (Australian ;) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: When someone from Britain speaks, Americans hear a "Britishaccent"...

2005-06-30 Thread Delaney, Timothy (Tim)
Grant Edwards wrote: > On 2005-06-30, Delaney, Timothy (Tim) <[EMAIL PROTECTED]> wrote: >> Tom Anderson wrote: >> >>> How about carrier? >> >> Ends in an "a" (Australian ;) > > Right, but due to some wierd property requiring conservatio

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-04 Thread Tim Williams (gmail)
On 7/4/05, Guy Lateur <[EMAIL PROTECTED]> wrote: > > Anything else I could try? Lateral thinking ? === untested === import imaplib, time, sys f = open(msg_file) r = f.readlines() f.close() msg1 = ''.join(r) server = 'my.exchangeserver.com' # or IP address user = 'user' pw = 'pw' M = imaplib.

RE: What are __slots__ used for?

2005-07-04 Thread Delaney, Timothy (Tim)
his is not the intended use, but it does happen. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-05 Thread Tim Williams (gmail)
On 7/5/05, Guy Lateur <[EMAIL PROTECTED]> wrote: > Thanks for the suggestion, Tim. Unfortunately, I get a 'connection refused' > error on the line 'M = imaplib.IMAP4(server)'. It says "socket.error: > (10061, 'Connection refused')". I'

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-05 Thread Tim Williams (gmail)
On 7/5/05, Guy Lateur <[EMAIL PROTECTED]> wrote: > > I just tried this and it failed with IP addresses but not > > hostnames/machine names, try it again with the server name. :) > > Nope, same problem. I think TJG might be right, and our server probably > doesn't have IMAP running (yet). Could y

RE: Conditionally implementing __iter__ in new style classes

2005-07-06 Thread Delaney, Timothy (Tim)
tance that does implement __iter__ will return the iterator from the subclass __iter__. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: I am a Java Programmer

2005-07-06 Thread Delaney, Timothy (Tim)
tml http://www.python.org/ Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: frozenset question

2005-07-06 Thread Delaney, Timothy (Tim)
ts still don't work, but contain lots of premature optimisations that combined have taken well over a week to put into place. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Thoughts on Guido's ITC audio interview

2005-07-07 Thread Delaney, Timothy (Tim)
Tony Meyer wrote: > It would be interesting to know which JRE the Eclipse advocates are > using, and which the people that dislike Eclipse are using... For me, performance is the minor issue. Usability is the major issue. If find Eclipse to be highly unusable, so I don't use it.

Date & time in a Zip File

2005-07-13 Thread Tim Williams (gmail)
Using zipfile.Zipfile How can I add a file to a zip file and keep its date and time correct? Currently the date/time change to the time the file was added to the zip.Zipinfo doesn't have a write method! Solutions other than zipfile are welcome, with snippets if possible :) ginmf in this ins

Re: open a mail and...

2005-07-15 Thread Tim Williams (gmail)
On 7/15/05, Alberto Vera <[EMAIL PROTECTED]> wrote: > > Hello > > Is it possible to open a mail and download its files attached in a hard-disk > using a python script? > > Regards > -- > http://mail.python.org/mailman/listinfo/python-list > yes, use the email module. >>> msg = email.message_from_

Re: dictionary that discards old items

2005-07-22 Thread Tim Williams (gmail)
On 7/21/05, Michael Hoffman <[EMAIL PROTECTED]> wrote: > Will McGugan wrote: > > > I need a collection class that behaves like a dictionary but when it > > reaches 'n' items it discards the oldest item so that the length never > > goes above 'n'. (Its for caching search results) > > > > I have a v

Re: how to build email message with attachment?

2005-07-26 Thread Tim Williams (gmail)
On 7/26/05, praba kar <[EMAIL PROTECTED]> wrote: > Dear All, > >Can any one let me know? How to build > email in python? with some some examples. > > regards > Prabahar The email module is what you need. http://docs.python.org/lib/module-email.html hth :) -- http://mail.python.org/mail

RE: functions without parentheses

2005-07-28 Thread Delaney, Timothy (Tim)
self.__x = value x = property(fget=_getX, fset=_setX) t = Test() t.x = 1 print t.x Note that this is almost completely different to what you asked about. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: [path-PEP] Path inherits from basestring again

2005-07-31 Thread Delaney, Timothy (Tim)
to Path() and Path(os.path.dirname(os.cwd()) respectively, and the unary division operator (which can either preceed or follow the object). Hey - paths are special enough to warrant additional syntax, aren't they? Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Is this Pythonic?

2005-08-01 Thread Delaney, Timothy (Tim)
ibuteError, because the method actually exists. In both cases though you need to know when you create the base class how it's going to be used to work out whether a super() call is needed. One option is to do a try: except (AttributeError, NotImplementedError). Yuk - talk about hiding errors :( Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: HELP:sorting list of outline numbers

2005-08-02 Thread Delaney, Timothy (Tim)
t = ['1', '1.2', '1.12', '1.1', '3.1'] decorated = [(numparts(txt), i, txt) for i, txt in enumerate(lst)] decorated.sort() lst[:] = [txt[-1] for d in decorated] This emulates the 2.4 sorting using `key` i.e. only the key is evaluated,

RE: HELP:sorting list of outline numbers

2005-08-03 Thread Delaney, Timothy (Tim)
Scott David Daniels wrote: > Delaney, Timothy (Tim) wrote: >> Scott David Daniels wrote: >>> For 2.3: (using DSU -- Decorate, Sort, Undecorate) > ... >>> lst = ['1', '1.2', '1.12', '1.1', '3.1'] >>&g

RE: Art of Unit Testing

2005-08-03 Thread Delaney, Timothy (Tim)
ng related - for example, you may want to test that changing a timeout works over various time periods. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Bizarre error from help()

2005-08-09 Thread Delaney, Timothy (Tim)
erpreter, is it possible that something you'd done before could have caused this? Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Recommendations for CVS systems

2005-08-09 Thread Delaney, Timothy (Tim)
ntrib files should be cleaned up once the merge is complete ... Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: "Ordered" dicts

2005-08-10 Thread Delaney, Timothy (Tim)
library ... Thread starts here: http://mail.python.org/pipermail/python-dev/2005-March/051915.html Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

FW: List copying idiom was Re: [Python-Dev] implementation of copystandard lib

2005-08-16 Thread Delaney, Timothy (Tim)
Tom Anderson wrote: > When you say [:], do you mean that you copy lists like this: > > l = someList() > m = [] > m[:] = l Forwarded to python-list, where it belongs. The idiom is actually: a = [1, 2, 3] b = a[:] Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: while c = f.read(1)

2005-08-23 Thread Delaney, Timothy (Tim)
it was going to be Laura Creighton? :) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Well, another try Re: while c = f.read(1)

2005-08-23 Thread Delaney, Timothy (Tim)
got his questions answered. FWIW, I agree with you, but then I'm another one who directs people to smart-questions. I also direct co-workers to it, and even myself on a semi-regular basis. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Doubt C and Python

2005-08-23 Thread Delaney, Timothy (Tim)
#x27;s easier (and shorter) to express many concepts/algorithms in Python than in other languages. This further contributes to it being more fun to code in Python. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: micro-python - is it possible?

2005-08-30 Thread Delaney, Timothy (Tim)
Wouter van Ooijen (www.voti.nl) wrote: >> No, not a tiny microcontroller environment. In the >> microcontroller world, "tiny" means 100 bytes of ram and 4KB of >> code space. > > That's medium :) > > PIC10F200: 256 12-bit instructions, 1

RE: GETTING IMAGEDATA FROM A BUTTON

2005-09-04 Thread Delaney, Timothy (Tim)
pythonprogrammer wrote: > Does anyone know how to get pixeldata from the image of a button > without taking a screenshot? Yes. http://www.catb.org/~esr/faqs/smart-questions.html Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Magic Optimisation

2005-09-04 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277940 For an even bigger improvement (in general), look at psyco: http://psyco.sourceforge.net/. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Unexpected Behavior Iterating over a Mutating Object

2005-09-13 Thread Delaney, Timothy (Tim)
...if len(x) > 6: a.insert(0, x) ... >>> a ['defenestrate', 'cat', 'window', 'defenestrate'] Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Roguelike programmers needed

2005-09-18 Thread Delaney, Timothy (Tim)
ore finally being decommissioned ... Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Why is map() preferable in this case?

2005-09-19 Thread Delaney, Timothy (Tim)
7;s coded in python, then the generator expression will probably be faster. Use whatever reads better to you. Look at optimising when you need to, and not before. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: style question: anything wrong with super(type(self), self).f() ?

2005-09-19 Thread Delaney, Timothy (Tim)
rably faster version available at: http://members.optusnet.com.au/tcdelaney/python.html#autosuper Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: inspect getsource() minor fix?

2005-09-19 Thread Delaney, Timothy (Tim)
> elif self.indent == 0: > raise EndOfBlock, self.last Please raise this as a bug report (with the patch) on Sourceforge, or it almost certainly won't be fixed. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Can someone explain what I've done wrong...

2005-09-19 Thread Delaney, Timothy (Tim)
Tim Roberts wrote: > Everything works OK while your script runs. When the script exits, > your "main" module goes to clean things up. Apparently, it does so > alphabetically. Nope - it would do it in the iteration order of the module's __dict__. Not something tha

Re: Question about smtplib, and mail servers in general.

2005-09-20 Thread Tim Williams (gmail)
On 20/09/05, Chris Dewin <[EMAIL PROTECTED]> wrote: > > s = smtplib.SMTP("server") > s.sendmail(fromaddress, toaddresess, msg) > > I know that in this instance, the toaddresses variable can be a variable > of type list. > > Suppose the list contains well over 100 emails. Would that create some >

Re: Question about smtplib, and mail servers in general.

2005-09-20 Thread Tim Williams (gmail)
On 20/09/05, Daniel Dittmar <[EMAIL PROTECTED]> wrote: > Chris Dewin wrote: > > Hi. I've been thinking about using smtplib to run a mailing list from my > > website. > > > > s = smtplib.SMTP("server") > > s.sendmail(fromaddress, toaddresess, msg) > > > > Not really an answer to your question, bu

Re: mailing from with python

2005-09-20 Thread Tim Williams (gmail)
On 20/09/05, M.N.A.Smadi <[EMAIL PROTECTED]> wrote: > hi; > if i want to send a mail message using the "mail" client on a machine > that has smtp protocol is there an easy way (i.e. like bash where you > would just type mail -s SUBJECT message RECIPIENT) to do it from a > python script? Any mail c

Re: information needed to make a connection between computers

2005-12-11 Thread Tim Williams (gmail)
On 11/12/05, John Walton <[EMAIL PROTECTED]> wrote:  Hello again! I'm still working on that instant messenger (for science fair), and I have been reading about networking in some Java tutorials. In one part of it, it said to have a connection with another computer, you need to know the IP name of t

Re: Displaying error message in a try except?

2005-12-11 Thread Tim Williams (gmail)
On 11/12/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote:> Fairly new to python.  In a try except how do you display the true> (raw) error message so it can be displayed back to the user? assuming that "true" means "the message you would get if you hadn'tused a try/except", the

RE: bizarre id() results

2005-12-15 Thread Delaney, Timothy (Tim)
ory allocator works, the second bound method created reused the same memory as the just-released bound method, and hence gave the same id(). Now, if you hold onto the bound methods, you will see that they get different IDs. >>> class A: ... def m1 (self): print "m1" ... def m2 (self): print "m2" ... >>> a = A() >>> m1 = a.m1 >>> m2 = a.m2 >>> id(m1) 10378576 >>> id(m2) 10383408 Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: Why and how "there is only one way to do something"?

2005-12-15 Thread Delaney, Timothy (Tim)
__ == '__main__': will run. The -c import invocation does not set the specified module as the __main__ module. The -m semantics are more normally what you want, and so -m has become the one obvious way to do it (assuming Python 2.4 and up). Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

RE: IsString

2005-12-15 Thread Delaney, Timothy (Tim)
function, the binding to the old object is lost, and the name is bound to a new object. Mutability is irrelevant. You can access the object via the bound parameter name, unless you rebind it. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the path of current running python script?

2005-12-20 Thread Tim Williams (gmail)
On 20/12/05, Kevin Yuan <[EMAIL PROTECTED]> wrote: I tried the following  getFilePath = lambda name: os.path.normpath('%s\\%s' % (sys.modules[name].prefix, sys.modules[name].__name__)) getFilePath('__main__') getFilePath =  sys.argv[0]    ?? :) -- http://mail.python.org/mailman/listinf

Re: checking if a string contains a number

2005-12-20 Thread Tim Williams (gmail)
On 20/12/05, Suresh Jeevanandam <[EMAIL PROTECTED]> wrote: Hi,I have a string like,s1 = '12e3's2 = 'junk'Now before converting these values to float, I want to check if theyare valid numbers.s1.isdigit returns False. Is there any other function which

Re: Queueing in Python (ala JMS)

2005-12-20 Thread Tim Williams (gmail)
On 20 Dec 2005 15:01:02 +0100, Stefan Arentz <[EMAIL PROTECTED]> wrote: Is there a JMS-like API available for Python? I would like toquickly receive messages through the network and then processthose slowly in the backgound. In the Java world I would simplycreate a (persistent) queue and tell the J

Re: coverting EST to PST

2005-12-21 Thread Tim Williams (gmail)
On 21 Dec 2005 03:15:47 -0800, Narendra < [EMAIL PROTECTED]> wrote: Hi All,i got a problem. I need to convert time from EST standard to PSTstandard.Thu, 15 Dec 2005 09:24:19 -0500 to PST Quick and dirty,   might not work for times at the end of DST >>> import time >>> from email import Utils >>>

Re: Parsing a date-time string?

2005-12-22 Thread Tim Williams (gmail)
On 21 Dec 2005 01:43:13 -0800, Tim N. van der Leeuw <[EMAIL PROTECTED]> wrote: Hi,I want to parse strings containing date-time, which look like thefollowing: "Mon Dec 19 11:06:12:333 CET 2005"[snipped]What I want to get is some sort of sortable date; either as a number or(if no

<    69   70   71   72   73   74   75   76   77   78   >