推荐学习书目
› 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
JCZ2MkKb5S8ZX9pq
V2EX  ›  Python

pandas 读取打开中的 excel

  •  
  •   JCZ2MkKb5S8ZX9pq · Feb 17, 2019 · 2850 views
    This topic created in 2784 days ago, the information mentioned may be changed or developed.
    • 在 excel 里编辑一些内容
    • 不时地需要用 python 导出些东西
    • 用 pandas 直接读取开启中的 excel 会报错
      PermissionError: [Errno 13] Permission denied: 'sample.xlsx'
      
    • 关掉 excel 再跑就好了

    请问

    • 想把 excel 每次复制一份再读,但 shutil.copyfile 也同样会报错。
    • 有啥其它解法嘛?有经验的请不吝赐教,先谢谢了。
    2 replies  •  2019-02-20 16:20:02 +08:00
    arrow8899
        1
    arrow8899  
       Feb 18, 2019
    用 shutil.copy
    JCZ2MkKb5S8ZX9pq
        2
    JCZ2MkKb5S8ZX9pq  
    OP
       Feb 20, 2019
    @arrow8899 shutil.copy 包含了 copyfile,好像是多复制了权限,一样会有 permission error。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2355 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 08:20 · PVG 16:20 · LAX 01:20 · JFK 04:20
    ♥ Do have faith in what you're doing.