Update parser.py

Fixed file opening issue.