python 中time.sleep没有作用
很简单的一个程序:
# -*- coding: utf-8 -*- import MySQLdb,os,json,time
#from wsgiref.simple_server import make_server
from cgi import parse_qs, escape
import sys def checkCompany(keyword = None):
row = None if row is None:
for i in range(10):
print(i, flush=True)
else :
return True
time.sleep(10)
return 'end' if __name__ == '__main__':
return_body = checkCompany() if return_body is None:
return json.dumps([{'data':123}])
else:
return return_body
但是根本就没有起作用time.sleep
The actual suspension time may be less than that requested because any caught signal will terminate the sleep() following execution of that signal’s catching routine.
python 中time.sleep没有作用的更多相关文章
- 浅析python 中__name__ = '__main__' 的作用
引用http://www.jb51.net/article/51892.htm 很多新手刚开始学习python的时候经常会看到python 中__name__ = \'__main__\' 这样的代码 ...
- 【转】浅析python 中__name__ = '__main__' 的作用
原文链接:http://www.jb51.net/article/51892.htm 举例说明解释的非常清楚,应该是看到的类似博文里面最简单的一篇: 这篇文章主要介绍了python 中__name__ ...
- 002_浅析python 中__name__ = '__main__' 的作用
很多新手刚开始学习python的时候经常会看到python 中__name__ = \'__main__\' 这样的代码,可能很多新手一开始学习的时候都比较疑惑,python 中__name__ = ...
- python中的双冒号作用
Python序列切片地址可以写为[开始:结束:步长],其中的开始和结束可以省略. 1. range(n)生成[0,n)区间整数 2. 开始start省略时,默认从第0项开始 3. 结尾省略的时候,默认 ...
- 理解 python 中__name__ = '__main__' 的作用
很多新手刚开始学习python的时候经常会看到python 中__name__ = \'__main__\' 这样的代码,可能很多新手一开始学习的时候都比较疑惑,python 中__name__ = ...
- python 中__name__ = '__main__' 的作用,到底干嘛的?
python 中__name__ = 'main' 的作用,到底干嘛的? 有句话经典的概括了这段代码的意义: "Make a script both importable and execu ...
- FAQ: Python中if __name__ == '__main__':作用
#hello.pydef sayHello(): str="hello" print(str); if __name__ == "__main__": prin ...
- Python中的pass的作用
1.pass语句什么也不做,一般作为占位符或者创建占位程序,pass语句不会执行任何操作2.保证格式完整 3.保证语义完整 以if语句为例,在c或c++/java中: ? if(true) ;//do ...
- Python中if __name__ == '__main__':作用
#hello.pydef sayHello(): str="hello" print(str); if__name__=="__main__": print ( ...
- python中的decorator的作用
1.概念 装饰器(decorator)就是:定义了一个函数,想在运行时动态增加功能,又不想改动函数本身的代码.可以起到复用代码的功能,避免每个函数重复性编写代码,简言之就是拓展原来函数功能的一种函数. ...
随机推荐
- 随机删除数据库N条记录
delete from table where newsID in(select top 50 newsID from table order by newid())
- CSS 中文字体的英文名称
宋体 SimSun 黑体 SimHei 微软雅黑 Microsoft YaHei 微软正黑体 Microsoft JhengHei 新宋体 NSimSun 新细明体 PMingLiU 细明体 Ming ...
- 免费VPN 实测可用
vpngate.net 的镜像站点列表 (更新于 2014-05-18 03:06:00 UTC): http://121.135.220.121:26633/cn/ (Mirror location ...
- The Havel-Hakimi Algorithm
1.If any di>=n then fail 2.If there is an odd number of odd degrees then fail 3.If there is a di& ...
- 变形--旋转 rotate()
旋转rotate()函数通过指定的角度参数使元素相对原点进行旋转.它主要在二维空间内进行操作,设置一个角度值,用来指定旋转的幅度.如果这个值为正值,元素相对原点中心顺时针旋转:如果这个值为负值,元素相 ...
- js 获取选中的多选框
前台html <span class="spbox"> <input type="checkbox" name="category& ...
- Server2003系统上的内置服务器设置某类IP无法访问问题
最近测试过程中遇到了一个很奇怪的现象,把服务器(测试产品)部署在Server2003系统的外网A上,把客户端(测试产品)部署在内网B,网络A,B用路由器相连,设置网络A为200.1.1.255,发现客 ...
- 累加两个php数组,键相同的累加,不同的合并
1. $arr1=array('name'=>33,'type'=>1); $arr2=array('name'=>33,'price'=>200); $res=array() ...
- 鸟哥的linux私房菜学习记录之例行性工作
- Unexpected error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xd2 in position 69: ordinal not in range(128)-解决办法