【问题标题】:Qpython unicode stringsQpython unicode 字符串
【发布时间】:2016-06-22 07:49:23
【问题描述】:

我正在尝试将 Python 3.5 项目从 PC 移植到 Android QPython3,但为了这条线:-

if ch = in u'\x00\xe0':
    ch = getwch()

我运行它时得到这个:-

if ch = in u'\x00\xe0':
                ^
  SyntaxError: invalid syntax

我认为QPython3 应该运行所有 3.x 脚本,而 Unicode 'u' 前缀不是新添加的,那么问题是什么?字符串中的十六进制数字有不同的处理方式吗?

【问题讨论】:

    标签: android python unicode-string qpython


    【解决方案1】:

    为了回答我自己的问题,经过一番折腾后,我得到了它的使用:-

    if ch in bytes([0x00, 0xe0]):

    改为。

    【讨论】:

      猜你喜欢
      • 2016-10-15
      • 2017-11-19
      • 2012-07-26
      • 2019-05-12
      • 1970-01-01
      • 2011-11-12
      • 2013-06-21
      • 2011-11-30
      • 2011-04-08
      相关资源
      最近更新 更多