Python input EOFError:EOF when reading a line

python input EOFError: EOF when reading a line

代码如下

  1 from multiprocessing import Process
  2 
  3 def test():
  4     print("----我是子进程-----")
  5     num = input("请输入内容:")
  6     print(num)
  7 
  8 print("-----主进程-----")
  9 p = Process(target=test)
 10 p.start()
 11 p.join()
 12 
 13 print("-----end------")

运行结果
Python input EOFError:EOF when reading a line

出错原因

python规定只能在父进程里面用input,在子进程里面调用input会报该错误