问题描述:

I have a piece of code, are these two equivalent? I understand that six module is used for making code compatible with both 2 and 3.

from six import b

os.write(w, b("EMount unsuccessful"))

os.write(w, b"EMount unsuccessful")

网友答案:

It depends on the python version you are using. In 2.6 or higher, those are equivalent and you can use u instead of u().

相关阅读:
Top