Check it again, it should work with write. Test first the script directly with your pc and one board.