SyntaxError: Non-ASCII character

Содержание
Ошибка
Решение
Похожие статьи

Довольно типичная ошибка для тех, кто использует кириллические символы или любые другие символы не входящие в ASCII.

File "args_demo.py", line 21 SyntaxError: Non-ASCII character '\xd0' in file args_demo.py on line 21, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

pep-0263

Возможно, проблему с кодировкой удасться решить добавлением нужной в начало файла

# coding=utf-8

Вместо utf-8 можно попробовать cp1251, iso-8859-15 или другую кодировку, которую вы подозреваете.

Поменять кодировку файла в Windows можно открыв его в блокноте и сохранив (Сохранть как → Кодировка) в другой кодировке

Про смену кодировки в Linux можете прочитать здесь

Article author: Andrei Olegovich

Похожие статьи
Сложности при работе с Python
Python
Установлено несколько версий Python
Установить дополнительную версию Python
Проверка системного пути
Куда устанавливаются различные версии Python
Ошибки типа AttributeError
Ошибки типа ModuleNotFoundError
Ошибки типа SyntaxError
Ошибки типа TypeError
TabError: inconsistent use of tabs and spaces in indentation
virtualenv : The term 'virtualenv' is not recognized
Не активируется виртуальное окружение
SSL module is not available
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position
error: Microsoft Visual C++ 14.0 or greater is required
Banner image

Search this site

Subscribe to Telegram channel @aofeed to follow new articles and updates to old ones

Go to channel

@aofeed

Ask a question in the Telegram group

@aofeedchat

Contacts and cooperation:
I recommend our hosting beget.ru
Write to info@urn.su, info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: