← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #272186]: double backslashes in printed strings --- is by convention (a \ must be escaped with a \ )

 

Question #272186 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/272186

    Status: Answered => Open

furni is still having a problem:
import os
import sys
import codecs
data = u"C:\\Users\\aaaaa\\Desktop\\依頼文\\sikuli_funcあ.txt".encode("utf-8")
print data
dir = os.path.dirname(data)
uprint("*** content of " + dir)
for fname in os.listdir(unicode(dir,"utf-8")):
  uprint(fname)
uprint("*** content of " + data)
for line in codecs.open(data,"r","shift_jis"):
    print line.encode("utf-8")
##################

print out

##################
C:\Users\aaaaa\Desktop\依頼文\sikuli_funcあ.txt
*** content of C:\Users\aaaaa\Desktop\依頼文
FIRST.sikuli
SECOND.sikuli
sikuli_funcあ.txt
新しいテキスト ドキュメント - コピー (2).txt
新しいテキスト ドキュメント - コピー (3).txt
新しいテキスト ドキュメント - コピー (4).txt
新しいテキスト ドキュメント - コピー.txt
新しいテキスト ドキュメント.txt
*** content of C:\Users\aaaaa\Desktop\依頼文\sikuli_funcあ.txt

##################

i did it! but still don't get the content of sikuli_funcあ.txt :((

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.