Wrote python flux code