【问题标题】:How to include Non-AscII character in python appengine send html mail如何在 python appengine 发送 html 邮件中包含非 AscII 字符
【发布时间】:2011-05-15 00:35:18
【问题描述】:

我的问题是我想在 google appengine 的 python 环境中写一封电子邮件。 当我在消息正文中添加希腊字符时,我得到: SyntaxError: 非 ASCII 字符 '\xce'

megssage.html = """
<html>
<body>
    παραδειγμα
</body>
</html>"""

【问题讨论】:

    标签: python html google-app-engine email


    【解决方案1】:

    使用这个shebang

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

    【讨论】:

    • @Chris 这意味着你搞砸了。这是一个工作代码pastebin.com/z7zBM2it。确保 shebang 位于文件的开头。
    • @Chris 不,'u' 应该作为字符串文字的前缀。
    猜你喜欢
    • 2018-02-25
    • 2019-02-07
    • 2023-04-07
    • 1970-01-01
    • 2018-07-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-19
    相关资源
    最近更新 更多