我遇到了使用python逐字符串地迭代unicode字符串的问题.
print "w: ",word
for c in word:
print "word: ",c
Run Code Online (Sandbox Code Playgroud)
这是我的输出
w: ??
word: ?
word: ?
word: ?
word: ?
word: ?
word: ?
Run Code Online (Sandbox Code Playgroud)
我想要的输出是:
?
?
Run Code Online (Sandbox Code Playgroud)
当我使用len(word)时我得到6.显然每个角色都是3个unicode块.
所以,我的unicode字符串成功存储在变量中,但我无法将字符输出.我尝试过使用encode('utf-8'),decode('utf-8)和编解码器,但仍然无法获得任何好的结果.这似乎是一个简单的问题,但对我来说却是令人沮丧的.
希望有人能指出我正确的方向.
谢谢!
我正在尝试按照本教程构建QR码阅读器
http://code.tutsplus.com/tutorials/android-sdk-create-a-barcode-reader--mobile-17162
我设法让一切工作,除了我需要相机作为我的设备的前置摄像头而不是后置摄像头.我在教程中找不到允许我更改此内容的任何地方.我试着按照这个答案,但我仍然无法让它工作.
主要是,我的问题是导入库.我收到以下错误.
operator is not allowed for source level below 1.7
Run Code Online (Sandbox Code Playgroud)
当我将编译器设置设置为1.7时,我得到了这个
Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead
Run Code Online (Sandbox Code Playgroud)
我对Android并不十分熟悉,如果这可能不是一个好问题,我会道歉.
那么,在我的应用程序中,我可以用任何方式将ZXing与前置摄像头配合使用吗?有链接吗?
非常感谢你.