[PyAR2] Loop? Sockets?
Kwadroke of The Wired
kwadroke at gmail.com
Fri Feb 15 21:13:07 CET 2008
On Fri, Feb 15, 2008 at 1:55 PM, Chad Cooper <Chad_Cooper at swn.com> wrote:
> Could you somehow use the last modified time of the file? But you still
> have to keep constantly checking that timestamp.
> -----Original Message-----
> From: W W [mailto:srilyk at gmail.com <srilyk at gmail.com>]
> Sent: Friday, February 15, 2008 01:52 PM Central Standard Time
> To: pyar2 at python.org
> Subject: [PyAR2] Loop? Sockets?
> I have a question about efficiency I suppose it is.
> I'm experimenting with a chat type program, and here's question:
> Would it be considered efficient to run an infinite loop continually
> opening and reading a file, say
> while True:
> f = open('convo.txt', 'r')
> f = f.readlines()
> print f
> Or some variant of that? Or are there sockets(?) or something that would
> work better? Basically I just want to be able to open it whenever the file
> is changed, so that seems like overkill (and probably a waste of cycles).
> To be considered stupid and to be told so is more painful than being
> called gluttonous, mendacious, violent, lascivious, lazy, cowardly: every
> weakness, every vice, has found its defenders, its rhetoric, its ennoblement
> and exaltation, but stupidity hasn't. - Primo Levi
> *Notice: This e-mail may contain privileged and/or confidential
> information and is intended only for the addressee. If you are not the
> addressee or the person responsible for delivering it to the addressee, you
> may not copy or distribute this communication to anyone else. If you
> received this communication in error, please notify us immediately by
> telephone or return e-mail and promptly delete the original message from
> your system.*
> PyAR2 mailing list
> PyAR2 at python.org
Would something like this work: http://pyinotify.sourceforge.net/ ?
Tony Bates - Kwadroke of The Wired
Red Hat Certified Engineer
Hot Springs Area Linux Users Group - hsalug.org
Little Rock Linux Users Group - lrlug.org
Central Arkansas Linux Users Group - carlug.org
Arkansas Linux Users Group - arlug.org
Arkansas Laser Tag - arklt.org
Kwadroke.com | Kwadrix.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyAR2