Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.39 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Integers from excel files become floats?
  2. >>> int(63.0)
  3. 63
  4. >>> int(sheet.row(1)[0].value)
  5. 63
  6.        
  7. If value is   TYPE returns
  8. Number        1
  9. Text          2
  10. Logical value 4
  11. Error value   16
  12. Array         64
  13.        
  14. if i==int(i): //checking for the integer:
  15.       print int(i)      // solving your problem and printing the integer
  16.     else:
  17.       print i           //printing the float if present