为什么我的python脚本的进程数增加? [关闭]

问题描述 投票:-1回答:1
当我运行python脚本时,即使python脚本中没有进程模块,进程数也会增加。

这是我的python脚本中使用的python模块:

from __future__ import division import os import sys import json import Queue import signal import shutil import logging import datetime import requests import platform import argparse import threading class Worker(threading.Thread): def __init__(self) threading.Thread.__init__(self) self.workers = [] def run(self): self.do_something() # file copy, symlink, etc... def do_something(self): ... shutil.copyfile(a, b) os.symlink(c, d) if __name__ == '__main__': for i in range(10): worker = Worker(item) worker.start() self.workers.append(worker)

而且,如何检查哪些模块/功能增加了进程数?
python process
1个回答
0
投票
尝试一次添加一个。我猜想罪魁祸首是threading
© www.soinside.com 2019 - 2024. All rights reserved.