python——unpack问题 ocr_recognize timeout , exception:unpack requires a string argument of length 46
rObjBuff = "".join(unpack('=%ds' % ObjLen, recv_buf[6+i*ObjLen:6+(i+1)*ObjLen]))
score, bbox1, bbox2, bbox3, bbox4, p00, p01, p10, p11, p20, p21, p30, p31, p40, p41 = unpack('=5f10H', rObjBuff)
错误示例:
rObjBuff = unpack('=%ds' % ObjLen, recv_buf[6+i*ObjLen:6+(i+1)*ObjLen])
score, bbox1, bbox2, bbox3, bbox4, p00, p01, p10, p11, p20, p21, p30, p31, p40, p41 = unpack('=5f10H', rObjBuff)
此时第二次unpack报错:ocr_recognize timeout , exception:unpack requires a string argument of length 40
,因为rObjBuff此时是tuple元组,而不是list,所以要"".join进行转换。
python——unpack问题 ocr_recognize timeout , exception:unpack requires a string argument of length 46的更多相关文章
- python函数参数的pack与unpack
python函数参数的pack与unpack 上周在使用django做开发的时候用到了mixin(关于mixin我还要写一个博客专门讨论一下,现在请参见这里),其中又涉及到了一个关于函数参数打包(pa ...
- 格式化namenode时 报错 No Route to Host from node1/192.168.1.111 to node3:8485 failed on socket timeout exception: java.net.NoRouteToHostException: No route to host
// :: FATAL namenode.NameNode: Failed to start namenode. org.apache.hadoop.hdfs.qjournal.client.Quor ...
- "docker build" requires exactly 1 argument(s).
Docker 是怎么样的东西,这里就不说了,这里说说dockerfile创建容器时遇到的问题. 首先我想达到的目的很简单,就是用dockerfile去创建容器,步骤如下: 创建并编辑dockerfil ...
- Docker问题:"docker build" requires exactly 1 argument.
今天在搭建Docker私有仓库的时候.提示错误:"docker build" requires exactly 1 argument. 原因是因为(少了一个 '.' , '.' 代 ...
- Python: ValueError: too many values to unpack
eg1: >>>a,b=(1,2,3) Traceback (most recent call last): File "<stdin>",line ...
- Python中struct.pack()和struct.unpack()
https://blog.csdn.net/tjuyanming/article/details/79700601 https://www.cnblogs.com/yezl/p/5861787.htm ...
- Python中获取异常(Exception)信息
异常信息的获取对于程序的调试非常重要,可以有助于快速定位有错误程序语句的位置.下面介绍几种python中获取异常信息的方法,这里获取异常(Exception)信息采用try...except...程序 ...
- Python中的异常(Exception)处理
异常 当你的程序出现例外情况时就会发生异常(Exception).例如,当你想要读取一个文件时,而那个文件却不存在,怎么办?又或者你在程序执行时不小心把它删除了,怎么办?这些通过使用异常来进行处理. ...
- 理解Python语言里的异常(Exception)
Exception is as a sort of structured "super go to".异常是一种结构化的"超级goto". 作为一个数十年如一日 ...
随机推荐
- (寒假开黑gym)2018 ACM-ICPC, Syrian Collegiate Programming Contest
layout: post title: (寒假开黑gym)2018 ACM-ICPC, Syrian Collegiate Programming Contest author: "luow ...
- 训练指南 UVALive - 3126(DAG最小路径覆盖)
layout: post title: 训练指南 UVALive - 3126(DAG最小路径覆盖) author: "luowentaoaa" catalog: true mat ...
- Linux下 编译C++/C以及常用的几种命令(ubuntu)
http://blog.csdn.net/bob1993_dev/article/details/45973919
- [BZOJ4530]大融合
LCT维护子树信息 维护两个子树信息,$vinf_x$表示节点$x$的所有轻儿子子树信息,$inf_x$表示以$x$为根的LCT子树(包含虚边)的信息 对$vinf$: access时,断开$x$的原 ...
- 【计算几何】 Codeforces Beta Round #67 (Div. 2) E. Ship's Shortest Path
读懂题意其实是模板题.就是细节略多. #include<cstdio> #include<cmath> #include<algorithm> using name ...
- 【斜率优化】BZOJ1096-[ZJOI2007]仓库建设
[题目大意] 有n个工厂编号分别为1-n,第i个仓库库存量为p[i],距离第1个仓库的距离为x[i](x[1]=0).在每一个工厂建立一个仓库费用为c[i],没有建立仓库的工厂只能往编号大于它的仓库运 ...
- 1.2(Spring MVC学习笔记) Spring MVC核心类及注解
一.DispatcherServlet DispatcherServlet在程序中充当着前端控制器的作用,使用时只需在web.xml下配置即可. 配置格式如下: <?xml version=&q ...
- Exercise02_03
import java.util.Scanner; public class Mi { public static void main(String[] args){ Scanner input = ...
- Spark1.4远程调试
1)首先,我们是在使用spark-submit提交作业时,使用 --driver-java-options ”-Xdebug -Xrunjdwp:transport=dt_socket,server= ...
- Java高级架构师(一)第18节:X-gen所需service、web层模板
以X-gen的Controller为例: package $#modulePackge#.web; import org.springframework.beans.factory.annotatio ...