推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Jelly
V2EX  ›  Python

python 用 xlrd 模块读取 excel 文件遇到的问题,求指教~

  •  
  •   Jelly · Aug 18, 2014 · 4667 views
    This topic created in 4287 days ago, the information mentioned may be changed or developed.
    excel中默认把数字和日期都存储为float类型,所以读出来的数都是在原数后面加了 .0,请问有没有方法直接 read as string 啊?
    Supplement 1  ·  Aug 18, 2014
    已解决。通过判断单元格的type来做不同的处理,例如type=3代表取出的是日期,那就xldate_as_tuple然后再转换成所需的字符串格式~~
    1 replies    2014-08-18 13:22:13 +08:00
    mengzhuo
        1
    mengzhuo  
       Aug 18, 2014
    str(x)?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4208 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 05:12 · PVG 13:12 · LAX 22:12 · JFK 01:12
    ♥ Do have faith in what you're doing.