more pythonic write_grub.py
Improved read_grub.py