Найти - Пользователи
Полная версия: Кодировка
Начало » Python для новичков » Кодировка
1
Art-master
Добрый вечер!

Возник вопрос - почему данный код не работает (точнее это кусок кода моей программы):
import Tkinter as tk
import sqlite3 as sql
import sys
sys.setdefaultencoding("utf-8")
# -*- coding: utf-8 -*-
root = tk.Tk()
root.geometry("700x425")
root.title(" BookStore ++")
home = tk.Label(root, text = "BookStore ++", font = "Times 17", bg = "#825825825")
home.place(x=10, y=6)
b_books = tk.Button(root, text = u"Книги", font = "Times 11", width = 10, bg = "#825825825", command = Books)
b_books.place(x=200, y=7)

Причем пишет мне
SyntaxError: Non-ASCII character ‘\xd0’ in file core.py on line 11 but no encoding declared; see http:\\python.org\peps\pep-0236.html for details

Подскажите, что я делаю не так.
bismigalis
# -*- coding: utf-8 -*-
должно быть в самом начале
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB