Changing pyrhon script to taking snapshot