title: Python unicode: how to test against unicode string
body: <p>I have a script like this:</p>
  
  <pre><code>#!/Python26/
  # -*- coding: utf-8 -*-
  
  import sys
  import xlrd
  import xlwt
  
  argset = set(sys.argv[1:])
  
  #----------- import ----------------
  wb = xlrd.open_workbook("excelfile.xls")
  
  #----------- script ----------------
  #Get the first sheet either by name
  sh = wb.sheet_by_name(u'Data')
  
  hlo = []
  
  for i in range(len(sh.col_values(8))):
     if sh.cell(i, 1).value in argset:
          if sh.cell(i, 8).value == '':
              continue
          hlo.append(sh.cell(i, 8).value)
  </code></pre>
  
  <p>excelfile.xls contains unicode strings and I want to test against these strings from command line:</p>
  
  <pre><code>C:\&gt;python pythonscript.py päätyö
  pythonscript.py:34: UnicodeWarning: Unicode equal comparison failed to convert both arguments to
  icode - interpreting them as being unequal
    if sh.cell(i, 1).value in argset:
  </code></pre>
  
  <p>How should I modify my code for Unicode?</p>