Hi
I would like to run 1 python published parameter or alternatively a startup script that can set to variables to access.
These are file names but the reason i need two is to ensure they both exist.
Here is the python with a few hard coded values while testing:
import os
inFolder = r'C:/temp/2015_11_26'
flow_data = []
speed_data = []
setlist = []
# Scan all files/sub directories etc
for root, dirs, files in os.walk(inFolder):
# reason xml is used is they wanted xml...no idea
for files in [f for f in files if f.endswith('.xml')]:
#print files
if 'speed' in files:
#print files
speed_file = os.path.join(root, files.split('_')[0])
speed_data.append(speed_file)
elif 'flow' in files:
flow_file = os.path.join(root, files.split('_')[0])
flow_data.append(flow_file)
else:
print 'Incorrect file', f
# put the matched items into a list to check if they exist in both
for setmatch in set(flow_data) & set(speed_data):
setlist.append(setmatch)
for itemlist in setlist[:1]:
speed_data_xml = os.path.join(root, itemlist + '_2015-10-01_TO_2015-10-31_avespeeddata.xml')
flow_data_xml = os.path.join(root, itemlist + '_2015-10-01_TO_2015-10-31_flowdata.xml')
Now i would like to have both speed_data_xml and flow_data_xml available to me as seperate parameters to call as two sources?
so i would have another python parameter ie:
import pyfme
speed_filename = speed_data_xml
return speed_filename
thanks