账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    python中的进程
    50
    0

    为什么multiprocessing的Process类必须要在if __name__="__main__"下调用,否则报错?这种情况只在Windows中存在,无法理解网上的解释

    Since Windows has no fork, the multiprocessing module starts a new Python process and imports the calling module. If Process() gets called upon import, then this sets off an infinite succession of new processes (or until your machine runs out of resources). This is the reason for hiding calls to Process() insideif name == "__main__"since statements inside this if-statement will not get called upon import.
    链接:https://www.zhihu.com/questio...
    0
    打赏
    收藏
    点击回答
        全部回答
    • 共 0 条
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部