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

ipython 中运行多线程,如何实现一边输出一边可以输入命令

  •  
  •   bmos · Aug 10, 2018 · 2295 views
    This topic created in 2976 days ago, the information mentioned may be changed or developed.
    如题,新手,在 spyder 中 ipython 窗口运行多线程的时候,发现有的时候既可以输出,又可以输入。有的时候就只有输出,没办法输入。没有找到规律,偷个懒问一问。
    1 replies  •  2018-08-10 20:02:55 +08:00
    LaFayette
        1
    LaFayette  
       Aug 10, 2018
    多线程一定要写 if __name__ == '__main__':, 所以在 ipython 中是没办法执行多线程的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2464 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:54 · PVG 21:54 · LAX 06:54 · JFK 09:54
    ♥ Do have faith in what you're doing.