Fixed python script to conform to new sendCode