To handle file encoding in Python, you can use the 'encoding' parameter when opening a file. For example, to open a file with UTF-8 encoding, you can use 'open(filename, encoding='utf-8')'. This ensures that the file is read or written with the correct character encoding.