title: Python returns global variable not defined
body: <p>I have a method that inside it I scan an excel file in python and in another method I want to check an entry in a list in which I extracted the data from the excel sheet in the first method as follows:</p>
  
  <pre><code>def first():
      nodes_sh = xlrd.open_workbook(file_location)
      sh_method = nodes_sh.sheet_by_index(0)
      global node_data_inter
      node_data_inter = [[sh_method.cell_value(rr, co) for co in range(sh_method.ncols)] for rr in range(sh_method.nrows)] #O(rows*cols) # A loop to get all the data in the excel sheet of "Nodes Co-ordinates"
      global node_positions_ascending_inter
      node_positions_ascending_inter = dc.deepcopy(node_data_inter) #O(rows*cols)
      for rowss in range(len(node_positions_ascending_inter)): #O(rows)
          del (node_positions_ascending_inter[rowss][0:3])
          del (node_positions_ascending_inter[rowss][2])
  
  
  def using_from_first_method():
      global node_positions_ascending_inter
      if node_positions_ascending_inter[0][0] == 1.25:
          print "Yes"
  </code></pre>
  
  <p>An error message is outputted when I type <code>using_from_first_method()</code></p>
  
  <pre><code>NameError: global name 'node_positions_ascending_inter' is not defined
  </code></pre>
  
  <p>Why is it outputted as I already have  defined <code>node_positions_ascending_inter</code> to be a global variable?</p>