On 9/2/2025 11:29 AM, amrodi9999--- via Python-list wrote:
I'm new to Python.
Operating System - Windows XP SP3
Python 2.7 installed.

I got a script that tries to improve the image?
I created a bat file using the command line.

C:\python27\python.exe d:\temp\teste.py

But even though it runs, it displays an error:

"... no encoding declare..."

Can anyone help?

My sincere thanks in advance.

The code file you posted contains several words that probably contain non-ascii characters (e.g., colorizacao). By default, Python 2.x uses ASCII encoding for the source file. You can tell it to use another encoding by a special comment at the start of the file that contains

"# coding: utf-8"

(or whatever encoding you want). One common comment format, which is understood by many Linux programs, is

# -*- coding: utf-8 -*-

Python 3.x uses utf-8 by default.

--
https://mail.python.org/mailman3//lists/python-list.python.org

Reply via email to