我有一个dict
对象,我试图在其中解析并仅捕获字符串的一部分。
我正在使用 McAfee EPO Python API,可以获取查询结果,但我认为这与这个问题无关。
这是对象中的字符串(多行类似内容)。我'WORKSTATION001'
要从这个字符串中提取文本。
{u'EPOLeafNode.NodeName': u'WORKSTATION001'}
这是我正在使用的代码:
for system in epoSystems:
computerName = system.rstrip().split('u')
print computerName
这导致:
computerName = system.rstrip().split('u')
AttributeError: 'dict' object has no attribute 'rstrip'
关于如何抓住那个字符串的任何想法?