Python - 输入时忽略新行

时间:2015-01-26 18:21:23

标签: python binary newline

我有一个程序输出输入字符串的二进制文件:

b = [format(ord(c), 'b') for c in m]
print(b)

这打印一切都很好,除非我输入像新行这样的字符,它会忽略那些的ascii值。例如:

>>>'hello[insert new line] qwertyuiop'
>>>['1101000', '1100101', '1101100', '1101100', '1101111']

实际上,程序忽略了新行之后的所有内容。我该怎么做才能解决这个问题?

0 个答案:

没有答案
相关问题