急急急 请大家帮我给月热情麻辣烫拌加盟 麻辣拌 起个名 不叫麻辣拌和月热情麻辣烫拌加盟 满意微信现金红包

20:19 提问
求助!!python web AttributeError 怎么改?
import socket
import xml.dom.minidom
import web
import threading
import json,time
g_nodetemp =''
'/(.*)', 'hello'
app = web.application(urls, globals())
class hello():
def GET(self,name):
name = (open('client.txt','r')).read().rstrip()
datatime = time.asctime()
print 'hello
'datatime',datatime
class Tcpclient():
'''docstring for Tcpclient'''
def __init__(self):
self.host ='192.168.48.78'
self.port = 9005
self.temp = ''
def Start(self):
s = socket.socket()
s.connect((self.host,self.port))
print 'Connection Succeful'
while True:
datarecv = s.recv(1024).rstrip()
self.temp = self.temp + datarecv
indexTail = self.temp.find('&/MotePacket&')
indexHead = self.temp.find('&MotePacket&')
if indexHead & 0 and indexTail&0 and indexHead & indexTail:
datarecv = self.temp[indexHead: indexTail+13]
get_tagname(datarecv)
self.temp = self.temp[indexTail+13:]
except Exception,e:
print 'connecting fail!',e
def interval():
if a == True:
time.sleep(10)
def get_tagname(tagname):
global g_nodetemp
dom = xml.dom.minidom.parseString(tagname)
root = dom.documentElement
for node in root.getElementsByTagName("PacketName"):
for child in node.childNodes:
print node.tagName+':',child.nodeValue
Dicdata = {}
Dicdata[node.tagName] = child.nodeValue
print Dicdata
for node in root.getElementsByTagName("NodeId"):
for child in node.childNodes:
node.tagName+':',child.nodeValue
Dicdata[node.tagName] = child.nodeValue
print Dicdata
datatime = time.asctime()
Dicdata['time'] = datatime
'datatime',datatime
datajson = json.dumps(Dicdata)
print 'datajson',datajson
f = open('client.txt','a')
f.write(datajson)
def test():
m = Tcpclient()
if name == '__main__':
print 'start client =&'
threading.Thread(target=test).start()
print 'start web server =&'
threading.Thread(target= app.run).start()
print 'interval=&'
threading.Thread(target=interval).start()
返回错误AttributeError:'module'object has no attribute'application'
按赞数排序
import socket
import xml.dom.minidom
import web
import threading
import json,time
g_nodetemp =''
'/(.*)', 'hello'
app = web.application(urls, globals())
class hello():
def GET(self,name):
name = (open('client.txt','r')).read().rstrip()
datatime = time.asctime()
print 'hello
'datatime',datatime
class Tcpclient():
'''docstring for Tcpclient'''
def __init__(self):
self.host ='192.168.48.78'
self.port = 9005
self.temp = ''
def Start(self):
s = socket.socket()
s.connect((self.host,self.port))
print 'Connection Succeful'
while True:
datarecv = s.recv(1024).rstrip()
self.temp = self.temp + datarecv
indexTail = self.temp.find('&/MotePacket&')
indexHead = self.temp.find('&MotePacket&')
if indexHead & 0 and indexTail&0 and indexHead & indexTail:
datarecv = self.temp[indexHead: indexTail+13]
get_tagname(datarecv)
self.temp = self.temp[indexTail+13:]
except Exception,e:
print 'connecting fail!',e
def interval():
if a == True:
time.sleep(10)
def get_tagname(tagname):
global g_nodetemp
dom = xml.dom.minidom.parseString(tagname)
root = dom.documentElement
for node in root.getElementsByTagName("PacketName"):
for child in node.childNodes:
print node.tagName+':',child.nodeValue
Dicdata = {}
Dicdata[node.tagName] = child.nodeValue
print Dicdata
for node in root.getElementsByTagName("NodeId"):
for child in node.childNodes:
node.tagName+':',child.nodeValue
Dicdata[node.tagName] = child.nodeValue
print Dicdata
datatime = time.asctime()
Dicdata['time'] = datatime
'datatime',datatime
datajson = json.dumps(Dicdata)
print 'datajson',datajson
f = open('client.txt','a')
f.write(datajson)
def test():
m = Tcpclient()
if name == '__main__':
print 'start client =&'
threading.Thread(target=test).start()
print 'start web server =&'
threading.Thread(target= app.run).start()
print 'interval=&'
threading.Thread(target=interval).start()
module'object has no attribute'application'
没有对应属性
其他相似问题君,已阅读到文档的结尾了呢~~
python常见错误,python错误处理,python 错误输出,python 错误检查,python 错误类型,python安装错误2503,python,python基础教程,python list,python 2.7
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
python常见错误
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口2013年10月 其他开发语言大版内专家分月排行榜第二2012年2月 其他开发语言大版内专家分月排行榜第二
2013年11月 其他开发语言大版内专家分月排行榜第三2012年4月 其他开发语言大版内专家分月排行榜第三2011年6月 其他开发语言大版内专家分月排行榜第三
匿名用户不能发表回复!|
每天回帖即可获得10分可用分!小技巧:
你还可以输入10000个字符
(Ctrl+Enter)
请遵守CSDN,不得违反国家法律法规。
转载文章请注明出自“CSDN(www.csdn.net)”。如是商业用途请联系原作者。下载作业帮安装包
扫二维码下载作业帮
1.75亿学生的选择
python菜鸟求助:如何在python中用e记法表示一个数的n次方>>> n=3>>> print 10enSyntaxError: invalid token>>> print 10e310000.0为什么两个结果不同?如何更改可以使第一个能行
tlBK91QR08
不行,那相当于计算了,算表达式。可以用10**n来计算
为您推荐:
n = 3print( float( '10e%d' % n ) )
>>> n = 3>>> print(10*10**n)10000
扫描下载二维码}

我要回帖

更多关于 月热情麻辣烫拌加盟 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信