在python中将xml文件添加到队列
如何将正在创建的xml文件添加到队列中?这个队列稍后需要由线程池执行 执行后,队列中必须包含8000个xml文件在python中将xml文件添加到队列,python,Python,如何将正在创建的xml文件添加到队列中?这个队列稍后需要由线程池执行 执行后,队列中必须包含8000个xml文件 from lxml import etree as ET import subprocess import os def frange(start, end, step): tmp = start while(tmp <= end): yield tmp tmp += ste os.chdir('C:\Users\Aravin
from lxml import etree as ET
import subprocess
import os
def frange(start, end, step):
tmp = start
while(tmp <= end):
yield tmp
tmp += ste
os.chdir('C:\Users\Aravind_Sampathkumar\Desktop\IMLC')
fileCount = 1
tree = ET.parse('C:\Users\Aravind_Sampathkumar\Desktop\IMLC\BO\IMLC_v4p8_Aravind.xml')
root = tree.getroot()
for child in root.iter('Traces'):
child.find('TS')
child.find('TW')
for i in frange(3,12.75,0.25):
child.set('TS',str(i))
for k in frange(3,12.75,0.25):
child.set('TW',str(i))
for child2 in root.iter('Stackup'):
child2.find('core_h')
for j in frange(2,4,0.5):
for child3 in root.iter('Definition'):
child3.set('modelname', 'Output{}.xml'.format(fileCount))
child2.set('core_h',str(j))
tree.write('C:\Users\Aravind_Sampathkumar\Desktop\IMLC\BO\Output{}.xml'.format(fileCount))
fileCount = fileCount+1
从lxml导入etree作为ET
导入子流程
导入操作系统
def法兰(开始、结束、步骤):
tmp=启动
虽然(tmp)文件包含xml这一事实是完全不相关的。我的基本意思是我想让他们进入一个队列。我使用队列!@Potato我想我们都理解这一点,希望如此。这并没有让提及“xml”更相关。