[Tutor] regexing and timing, seperatly

Galen O'Neil goneil@scu.edu
07 Oct 2002 22:18:56 -0700


1.  I can't seem to find a simple tutorial or example on timing.  I want
an infinite loop but I don't want it to eat all my cpu time.  I've
looked at a few programs that use tkinter and root.mainloop() but I
can't imagine there aren't some other ways that don't involve tkinter. 
So if anybody knows where I can find a decent tutorial or has some
sample code, that would be great.

2.  I'm taking data from a telnet session (using telnetlib) but I can't
seem to do regexs on it.  Here's an example:

this result from this code:

print "***searching data, data at this moment contains***"
print data
import re
m = re.match("Player", data)
if m:
    print 'Match found: ', m.group()
else:
    print 'No match'
    

***searching data, data at this moment contains***


=======================[   God Wars : Rogue
Edition    ]=======================

                |

AVATARS        -|

Immortal    
0.45   (Ronin)                      Wolfe the
mortal

Login Timer  0.00   {Yellow Invoker}            
AutoKelvan tell me hi

Avatar       0.00   {=Rogue
Lemure=}             Shaddai the demonator

                |

MORTALS        -|

Mortal+      None
                              
InfuriaterSuEs

Mortal+      None
                               Lerdos the
mortal

                |

===============================================================================

| Current | Players Visible :
5   | Arena Status : Challenge In Progress     
|

| Stats   | Most Players    :
21  | Player Kills : 4491 | Status
Kills : 2996 |

===============================================================================



<7970 qp> <21000H 22166M
4000V>
No match


You may notice that the word player is in the string, but it still
returns no match.  Any ideas?

--Modig