V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2018-08-10 15:07:55 +08:00 · 1699 次点击
    这是一个创建于 2084 天前的主题,其中的信息可能已经有所发展或是发生改变。
    如题,新手,在 spyder 中 ipython 窗口运行多线程的时候,发现有的时候既可以输出,又可以输入。有的时候就只有输出,没办法输入。没有找到规律,偷个懒问一问。
    1 条回复    2018-08-10 20:02:55 +08:00
    qianc1990
        1
    qianc1990  
       2018-08-10 20:02:55 +08:00
    多线程一定要写 if __name__ == '__main__':, 所以在 ipython 中是没办法执行多线程的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5360 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 08:27 · PVG 16:27 · LAX 01:27 · JFK 04:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.