python版本升级问题
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
·
python脚本语言确实很强大,但是在更新版本的时候却出现不向下兼容问题,这给我们的开发和升级带来诸多的不便,下面将我在更新版本之后遇到的几个问题记录如下:
最初我是在python低版本中进行的程序开发,现在进行python版本的升级,我的虚拟机采用linux操作系统,自带的python版本是2.4.3,我的windows操作系统安装的是最新的3.2.2版本。
1、“inconsistent use of tabs and spaces in indentation”这个错误让人很抓狂,设置都没有问题,可就是报这个错误,最后在新版本中重新写了一遍,却又没有发现这个问题,查了资料说是由空格和tab键的问题。
2、socket.error: (11, 'Resource temporarily unavailable');socket文件在编译时报这个错误,查了11是EWOULDBLOCK,非阻塞模式下产生的中断,看了下代码,我前面是有设置s.setblocking(False),查文档,原来这个非阻塞相当于设置了超时时间为0,所以会报这个错误,所以在设置非阻塞模式时,我们最好显式的声明一下其超时时间。
socket.setblocking(flag)
Set blocking or non-blocking mode of the socket: if flag is false, the socket is set to
non-blocking, else to blocking mode.
This method is a shorthand for certain settimeout() calls:
sock.setblocking(True) is equivalent to sock.settimeout(None)
sock.setblocking(False) is equivalent to sock.settimeout(0.0)
此文章由指尖极客原创,转载请指出其作者和出处!http://blog.csdn.net/wenchao126
A beautiful web dashboard for Linux
最近提交(Master分支:1 个月前 )
186a802e
added ecosystem file for PM2 5 年前
5def40a3
Add host customization support for the NodeJS version 5 年前
新一代开源开发者平台 GitCode,通过集成代码托管服务、代码仓库以及可信赖的开源组件库,让开发者可以在云端进行代码托管和开发。旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。
更多推荐


所有评论(0)