[Tutor] pyLpd

Emil Styrke emil@lysator.liu.se
Mon Jan 6 13:24:06 2003


janos.juhasz@VELUX.com wrote:
> Dear all,
> 
> This would be the very base of my test lpd, but i don't know how can i send
> back an 'octete of zero bits' for acknowledgement
> with self.wfile.write()

That would be a byte (octet) with the value 0. You can produce one with 
the string "\0". (Unlike in C, where this would just result in an empty 
string.)

	/Emil
> 
> ******
> import SocketServer
> 
> 
> class pyLpd(SocketServer.StreamRequestHandler):
>       def handle(self):
>             lines = self.rfile.readlines()
>             self.wfile.write()
>             print lines
> 
> 
> if __name__ == '__main__':
>       server = SocketServer.TCPServer( ('', 515), pyLpd)
>       server.serve_forever()
> *****
> 
> Best regards,
> -----------------------
> Juhász János
> IT department
> 
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor