
1 lerry 2015 年 3 月 31 日 错误提示是什么,无法执行的表现是什么? |
2 wuhang89 2015 年 3 月 31 日 你既然是学python起码要知道最基本的代码格式吧 from multiprocessing import Process def f(name): print('hello', name) p = Process(target=f, args=('bob',)) p.start() p.join() |
3 wuhang89 2015 年 3 月 31 日 from multiprocessing import Process def f(name): print('hello', name) p = Process(target=f, args=('bob',)) p.start() p.join() |
4 wuhang89 2015 年 3 月 31 日 sorry,这个回复框无法贴代码格式,代码是可以执行的,已测。 |
5 jun4rui 2015 年 3 月 31 日 可执行,已经测试。平台是Linux Mint 1.7.1+Python 3.4.0 > from multiprocessing import Process def f(name): print('hello', name) if __name__ == '__main__': p = Process(target=f, args=('bob',)) p.start() p.join() |
6 sure15 OP @lerry 无任何提示,就是这样子: >>> ================================ RESTART ================================ >>> >>> |
7 sure15 OP @wuhang89 >>> ================================ RESTART ================================ >>> >>> 我的是这种提示,不知道你用的是什么环境? |
8 aaaa007cn 2015 年 3 月 31 日 又没有重定向子进程的输出 当然没提示啊 |
9 sandtears 2015 年 3 月 31 日 IDLE 只能获取到你父进程的输出,然而你的输出是在子进程的。 |