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

Python 项目大了后如何调试单个文件

  •  
  •   shallyy · Jul 13, 2017 · 2805 views
    This topic created in 3362 days ago, the information mentioned may be changed or developed.

    接手别人的项目 launch.py 没问题 运行单个文件就 No module named... 真是被头文件搞得头大..

    4 replies  •  2017-07-13 14:52:11 +08:00
    matthewgao
        1
    matthewgao  
       Jul 13, 2017
    不要单个跑 打 log 就好
    ryd994
        2
    ryd994  
       Jul 13, 2017
    所以你需要测试脚手架……
    awanabe
        3
    awanabe  
       Jul 13, 2017   ❤️ 1
    在项目顶层写一个 这个文件的引用 再调用。
    可以使用到项目的环境依赖
    kinghui
        4
    kinghui  
       Jul 13, 2017   ❤️ 1
    这个要看项目的目录结构, 一般可以通过在 `launch.py` 所在目录将 `python path/to/script.py` 替换成 `python -m path.to.script` 解决.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2471 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 10:55 · PVG 18:55 · LAX 03:55 · JFK 06:55
    ♥ Do have faith in what you're doing.