python改xml文档属性值遇到的一点小问题
xml文档的部分截图:
要改选中行timemax的值,我写的代码如下:
TimeMax_user = self.posCtrl3.GetValue()
TimeMax = root.find('execution').find('parameters').find('parameter').find('[@comment="Time of simulation"]')
print(TimeMax)
root.attrib
TimeMax.set('value',TimeMax_user)
报错提示是:'NoneType' object has no attribute 'set'
改了几次都是提示这个,求指教