Python scripting and modular coding of Perceptron