Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Python 3.3 中,执行此行时出现错误:
print ("Message from server : ") + msg
从服务器接收到的数据在哪里msg(尝试进行套接字编程,您可能会猜到)
msg
print()在 Python 3 中返回None。因此,您尝试与 连接(或添加)None,msg这会导致错误。
print()
None
尝试字符串格式化:
print ("Message from server : {}".format(msg))