You can pass sa_data and ia_lines as parameters to get_num and checkWin.
Python checks first the local variables and if the variable is no there checks the global space. It's good to be local.
You can use lxml to parse the document and make the code more readable. I don't know how efficient will be.
These nested for loops...
Python checks first the local variables and if the variable is no there checks the global space. It's good to be local.
You can use lxml to parse the document and make the code more readable. I don't know how efficient will be.
import lxml with open('Text.txt', 'r') as fin: tree = lxml.etree.parse(fin) ti_reelNum = 0 for tag in tree.iterfind(".//*[@name]": print(tag.attrib['name']) # just for test # your code hereI think scipy can handle in much more efficient way such data structure as sa_data but I never used it so can't help here.
These nested for loops...
