SyntaxError: Non-ASCII character '\xe8' in file delete.py on line 4, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details 运行程序报上面的错误 解决方法: 1.在程序开头加入#coding:utf-8 #!/usr/bin/env python# coding: utf-8…
如何让你的Python程序支持多语言 本文介绍如何通过Python标准库gettext帮助你的程序支持多语言. 代码例子 import random guessesTaken = 0 print(_("Hello! What's your name?")) myName = input() number = random.randint(1, 20) print("Well, {}, I am thinking of a number between 1 and 20.&qu…