Python script to be used with netcat