added python socket code