有时候需要某些方法在后台运行,而不是同步代码进行,这时候就需要使用到multiprocessing 来实现
import multiprocessing as mp
import xxxx
tm=xxxx.Xxxx()
p=mp.Process(target=tm.run)
p.start()
class Xxxx:
def __init__(self):
pass
def run(self):
pass
最后
以上就是爱笑故事最近收集整理的关于python 后台运行某function的全部内容,更多相关python内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复