title: return Set of lists from out of function: python
body: <p>Method <code>collectInfoFromXLS()</code> extracts all the contents which are under <code>quotes ('')</code> from given XLS file, and  puts in an <code>List</code>.</p>
  
  <pre><code>class ExtractInfo(object):
  
      def collectInfoFromXLS():
          workbookPath = config.get('TestCaseFileURL','XLSpath')
          workbook = xlrd.open_workbook(workbookPath)
          SheetPath = config.get('TesCaseSheetName','Sheet1')
          worksheet = workbook.sheet_by_name(SheetPath)
          numOfRows = worksheet.nrows - 1
          curr_row = 0
          row1 = []
          row2 = []
          while curr_row &lt; numOfRows:
             curr_row += 1
             row2 = []
             row = worksheet.row(curr_row)
             for value2 in re.findall(r"'(.*?)'", str(row)):
                  row2.append(value2)
             return row2
  </code></pre>
  
  <p>I get output of this method when I print <code>row2</code> is like</p>
  
  <pre><code>['', 'MUC-EC-099_SC-Memory-01_TC-1', 'Description1.', '', '', '', '', '', '', '', '', '', '', '', '']
  ['', 'MUC-EC-099_SC-Memory-01_TC-2', 'Description2', '', '', '', '', '', '', '', '', '', '', '', '']
  ......
  </code></pre>
  
  <p>I want to call this method from outside of the class, like</p>
  
  <pre><code>Classobject = ExtractInfo(object)
  print Classobject.collectInfoFromXLS()
  </code></pre>
  
  <p>So that I could get every rows exactly like <code>print</code> inside method,
  I don't want to append <code>rows2</code> inside one more list, because it makes problem while retrieving.</p>