我如何让 python 检查列表是否发送到套接字服务器或从套接字服务器发送?
我试图让一个泡菜文件“服务器端”存储玩家坐标列表。然后服务器将该 pickle 文件发送到客户端。另外,我需要一种方法让客户端在腌制文件中查找这些坐标。
我如何让客户查看包含各种不同信息的pickle 文件。并让它从文件中提取坐标吗?
I'm trying to have a pickle file "server side" store a list of player coordinates. Server then sends that pickle file to the client. Also, i need a way for the client to look in the pickled file, for those coordinates.
How would i have the client look in the pickle file that would have all sorts of different information. And have it pull the coordinates from the file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需在客户端unpickle它并检查您需要验证的内容即可。
我假设您正在编写或正在编写服务器和客户端部分。在这种情况下,您需要预先决定存储和检索的内容。例如,如果您在服务器端的 pickle 文件中存储了一个名为
l
的列表,那么在客户端您可以取消pickle,并且可以将其作为l
使用。Just unpickle it at the client end and check for what you need to verify.
I am assuming that you are written or writing both the server and the client part. And in which case, you decided upfront what you store and retrieve. For e.g. if you stored a list named
l
in the pickle file at the server end, at the client end you can unpickle and it is available to you asl