Using udp to send out message is a convenient way, you may define a log function like following, and start a udp server to lisen. ############# from socket import * udpSock = socket(AF_INET,SOCK_DGRAM) def log(s): udpSock.sendto(s, ('127.0.0.1', 514)) log('hello')