<div>The problem is the infies are also being used in a shell scripted environment, they are frequently updated and cannot be changed.</div>
<div> </div>
<div>So ideadly I could just define a function which sourced the file, assuming the variable names passed in the *args list. So, yes, I know the names, they just haven't been set in the program. I would like the source program to then define them. My re is not so great, but I'm assuming the statement here:
</div>
<div> </div>
<div><font face="Courier New">cmd = '\n'.join([re.sub( r'^([^=]+)=(.*)$', r"\1='\2'", v) for v in lines])</font><br> </div>
<div>assumes the pattern VAR[i]=variable , and then makes it Python friendly.</div>
<div> </div>
<div>So it would look like:</div>
<div> </div>
<div>my_source(fid,['STN_id','STNlat','STNlon','STNelv'])</div>
<div> </div>
<div>then in the program, before exec(cmd) the *args list has to be converted into empy lists, preparing it for the cmd. Does that make sense?? </div>
<div> </div>
<div>Thanks!</div>
<div> </div>