我的代码:
import xml.etree.ElementTree as ET
import sys
XS = '{http://pubchem.ncbi.nlm.nih.gov/pug_view}'
mols = {'CID_11249995','CID_11249995'}
molstring = str(mols);
tree = ET.fromstring(open('C:/Python27/xml/'+ molstring +'.xml','r'))
root = tree.getroot( )
print(root)
这将产生以下错误:
Traceback (most recent call last): File "C:\Users\HENRY\Desktop\prac1.py", line 6, in tree = ET.fromstring(open('C:/Python27/xml/'+ molstring +'.xml','r')) IOError: [Errno 2] No such file or directory: "C:/Python27/xml/set(['CID_11249995', 'CID_11249995']).xml"
用于从多个xml文件读取数据
相关问题 更多 >
编程相关推荐