Python SyntaxError: Non-ASCII character ‘\xa3’ in file when function returns ‘£’ Huang Shiyang June 19, 2018 putting # -*- coding: utf-8 -*- at the top of your .py file.