python转换wps word文档出错

pb467177235 2016-05-28 05:25:11
('Opening', '/opt/pythontest/sample.doc')
Traceback (most recent call last):
File "doc2pdf.py", line 14, in <module>
doc = app.get_Documents().Open(file)
File "/opt/pythontest/wpsrpcclient.py", line 326, in __call__
return self.__send(self.__name, args)
File "/opt/pythontest/wpsrpcclient.py", line 301, in __request
return sendApiRequest(self.uri, methodName, params)
File "/opt/pythontest/wpsrpcclient.py", line 62, in sendApiRequest
response = sendRequest(rpcClientPort, uri, request)
File "/opt/pythontest/wpsrpcclient.py", line 153, in sendRequest
sock.send('''POST %s HTTP/1.1\r\nContent-Type: text/xml\r\nContent-Length: %s\r\n\r\n%s''' % (uri, len(request), request))
socket.error: [Errno 107] Transport endpoint is not connected

代码链接
http://bbs.wps.cn/thread-22584090-1-1.html
...全文
296 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
jianwu5 2016-06-04
  • 打赏
  • 举报
回复
查看socket.send的格式与参数是否正确,特别是最好是不要用\r\n换行,因为不同的系统有不同的换行符。

20,360

社区成员

发帖
与我相关
我的任务
社区描述
“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。PHP语法利用了C、Java和Perl,该语言的主要目标是允许web开发人员快速编写动态网页。
phpphpstorm 技术论坛(原bbs)
社区管理员
  • 开源资源社区
  • phpstory
  • xuzuning
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧