<DIV>&nbsp; Dear Friends and Tutors,</DIV>
<DIV>&nbsp; Thanx for all your previous answers I have a new problem</DIV>
<DIV>&nbsp; I am writing&nbsp;a python script which will connect to Internet Chess Club via telnet(the IP of the server is '65.245.208.34' and the port I want is 5056)</DIV>
<DIV>&nbsp; Connecting works fine :</DIV>
<DIV>&nbsp; "import telnetlib</DIV>
<DIV>&nbsp;&nbsp; telnetlib.Telnet(host='65.245.208.34',port='5056')"</DIV>
<DIV>Now the server asks for username and password...</DIV>
<DIV>I want the programme to login as guest so :</DIV>
<DIV>&nbsp; "a=telnetlib.Telnet(host='65.245.208.34',port='5056')</DIV>
<DIV>&nbsp;&nbsp;&nbsp;a.read_until('login:')</DIV>
<DIV>&nbsp;&nbsp; a.write('guest \n')"</DIV>
<DIV>&nbsp;&nbsp;Now programme is connected to the server.Now I want to type commands and such things...Before I write a command I should do</DIV>
<DIV>&nbsp;"a.read_until('aics%')"</DIV>
<DIV>&nbsp;to get the command line.</DIV>
<DIV>But the problem starts here.Some announces and chats come from the server and the server seems like that</DIV>
<DIV>&nbsp;"xxx shouts: hi all</DIV>
<DIV>aics%</DIV>
<DIV>bbb shouts:hi again</DIV>
<DIV>aics%_"</DIV>
<DIV>The real command line is the second "aics%" but the programme types "a.read_until('aics%') only once so that when I type in a command programme doesn't send the command to the server.</DIV>
<DIV>So&nbsp;I should make the programme type "a.read_until('aics%')" every 5 seconds or so...</DIV>
<DIV>Can anyone show me how and where to do this change?</DIV>
<DIV>Below is the script :</DIV>
<DIV>"def icc():<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a=telnetlib.Telnet(host='65.245.208.34',port='5056')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print str(a.read_until('login:'))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.write('guest')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.write('\n')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.read_until('aics%')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.write('-ch 1\n')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.read_until('aics%')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.write('-ch 165\n')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.read_until('aics%')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.write('set shout 0\n')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.read_until('aics%')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.write('set sshout 0\n')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.read_until('aics%')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print
 str(a.read_until('aics%'))&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for x in range(500000):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d=raw_input(Command :&gt;')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.write(str(d))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a.write('\n')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print str(a.read_until('aics%'))</DIV>
<DIV>Regards,</DIV>
<DIV>Ali Polatel</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV><p>
                <hr size=1>Do you Yahoo!?<br>
Yahoo! Mail is new and improved - <a href="http://us.rd.yahoo.com/mail_us/taglines/new/*http://promotions.yahoo.com/new_mail">Check it out!</a>