Python 连接到url阻止web连接

Python 连接到url阻止web连接,python,Python,我连接到url,它会在5分钟内完成一些操作,同时不可能连接到此站点,因为http请求使用相同的地址进行通信 我通过ajax-in java脚本运行python代码 java脚本代码: 变量结构={ $:jQuery.noConflict() } Python代码: def更新数据(a): 打印“更新数据” res = False global_server = 'http://10.184.197.149:8055' try: response = urllib2.urlopen(g

我连接到url,它会在5分钟内完成一些操作,同时不可能连接到此站点,因为http请求使用相同的地址进行通信

我通过ajax-in java脚本运行python代码

java脚本代码: 变量结构={ $:jQuery.noConflict()

} Python代码: def更新数据(a): 打印“更新数据”

res = False
global_server = 'http://10.184.197.149:8055' 

try:
    response = urllib2.urlopen(global_server)
    url_res = response.read()
except Exception, e:
    print(e)
    return HttpResponse(e.message)

return HttpResponse(url_res.strip())
这个问题是由url打开的C#代码中的“Task”引起的

res = False
global_server = 'http://10.184.197.149:8055' 

try:
    response = urllib2.urlopen(global_server)
    url_res = response.read()
except Exception, e:
    print(e)
    return HttpResponse(e.message)

return HttpResponse(url_res.strip())