Change initialize shell script to Python