Working towards socket implementation of python script