Python-error 进程不放在 ’__main__‘函数中时引发的错误

 error:

An attempt has been made to start a new process before the current process has finished its bootstrapping phase. 

Python-error 进程不放在 ’__main__‘函数中时引发的错误_第1张图片

 

解决的办法:上图错误中已经提示,

需要将进程process.start()放在 if __name__ == '__main__':的函数内。

 

你可能感兴趣的:(python)