当前位置: 首页>>代码示例>>Python>>正文


Python Process.__init__方法代码示例

本文整理汇总了Python中multiprocessing.Process.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Process.__init__方法的具体用法?Python Process.__init__怎么用?Python Process.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在multiprocessing.Process的用法示例。


在下文中一共展示了Process.__init__方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
def __init__(self,camera):
    self.camera = camera
    self.label_shape = 800,600
    self.scale_length = 350
    self.last_reticle_pos = (0,0)
    self.root = tk.Tk()
    self.root.protocol("WM_DELETE_WINDOW",self.stop)
    self.zoom_step = .1
    self.reset_zoom()
    self.img = self.camera.read_image()[1]
    self.on_resize()
    self.convert_img()
    self.create_window()
    self.update_img()
    self.start_histogram()
    self.update_histogram()
    self.refresh_rate = 1/50
    self.low = 0
    self.high = 255
    self.t = time()
    self.t_fps = self.t
    self.go = True
    #self.main() 
开发者ID:LaboratoireMecaniqueLille,项目名称:crappy,代码行数:25,代码来源:cameraConfig.py

示例2: __init__

# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
def __init__(self, ms_file_path, queue, start_scan=None, max_scans=None, end_scan=None,
                 no_more_event=None, ignore_tandem_scans=False, batch_size=1, log_handler=None):
        if log_handler is None:
            log_handler = show_message
        Process.__init__(self)
        self.daemon = True
        self.ms_file_path = ms_file_path
        self.queue = queue
        self.loader = None

        self.start_scan = start_scan
        self.max_scans = max_scans
        self.end_scan = end_scan
        self.ignore_tandem_scans = ignore_tandem_scans
        self.batch_size = batch_size

        self.log_handler = log_handler

        self.no_more_event = no_more_event 
开发者ID:mobiusklein,项目名称:ms_deisotope,代码行数:21,代码来源:process.py

示例3: __init__

# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
def __init__(
        self,
        queue: JoinableQueue,
        arguments: str,
        ports: str,
        sudo: bool,
        hosts_quantity: int,
        results_pool: dict,
    ):
        Process.__init__(self)
        self.queue = queue
        self.arguments = arguments
        self.ports = ports
        self.sudo = sudo
        self.quantity = hosts_quantity
        self.results_pool = results_pool 
开发者ID:sdnewhop,项目名称:grinder,代码行数:18,代码来源:nmapprocessmanager.py

示例4: __init__

# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
def __init__(
        self,
        ip_script_mapping: dict,
        hosts_info: dict,
        workers: int = 100,
        mute: bool = False,
    ):
        """
        Initialize a process manager with a set of scripts, host information and additional flags

        :param ip_script_mapping: mapping ip addresses to run scripts
        :param hosts_info: host information list
        :param workers: number of running processes
        :param mute: bool flag for running scripts in silent mode (w/o output at all)
        """
        freeze_support()
        self.manager = Manager()
        self.results_pool = self.manager.dict({})
        self.ip_script_mapping = ip_script_mapping
        self.hosts_info = hosts_info
        self.workers = workers
        self.mute = mute 
开发者ID:sdnewhop,项目名称:grinder,代码行数:24,代码来源:pyscriptexecutor.py

示例5: __init__

# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
def __init__(self, restart=None, ignore_bad_restart_file=False, label=None,
                 atoms=None, calc=None, block=False, **kwargs):
        '''Basic calculator implementation.
        restart: str
            Prefix for restart file.  May contain a directory.  Default
            is None: don't restart.
        ignore_bad_restart_file: bool
            Ignore broken or missing restart file.  By default, it is an
            error if the restart file is missing or broken.
        label: str
            Name used for all files.  May contain a directory.
        atoms: Atoms object
            Optional Atoms object to which the calculator will be
            attached.  When restarting, atoms will get its positions and
            unit-cell updated from file.

        Create a remote execution calculator based on actual ASE calculator 
        calc.
        '''
        logging.debug("Calc: %s Label: %s" % (calc, label))
        Calculator.__init__(self, restart, ignore_bad_restart_file, label, atoms, **kwargs)
        logging.debug("Dir: %s Ext: %s" % (self.directory, self.ext))
        self.calc=calc
        self.jobid=None
        self.block=block 
开发者ID:jochym,项目名称:Elastic,代码行数:27,代码来源:parcalc.py

示例6: __init__

# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
def __init__(self, nthreads=None):
        self.nthreads = nthreads
        self.sys_threads = None 
开发者ID:pyscf,项目名称:pyscf,代码行数:5,代码来源:misc.py

示例7: __init__

# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
def __init__(self):
        self._read_queue = Queue()
        self._write_queue = Queue()
        self._worker = None 
开发者ID:csvance,项目名称:armchair-expert,代码行数:6,代码来源:model_common.py

示例8: __init__

# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
def __init__(self, text: str, learn: bool=False, reply=True):
        self.text = text
        self.learn = learn
        self.reply = reply 
开发者ID:csvance,项目名称:armchair-expert,代码行数:6,代码来源:connector_common.py

示例9: __init__

# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
def __init__(self, pipe, domain, user, password, lmhash, nthash):
        Process.__init__(self)
        self._pipe = pipe
        self._domain = domain
        self._user = user
        self._password = password
        self._lmhash = lmhash
        self._nthash = nthash 
开发者ID:the-useless-one,项目名称:pywerview,代码行数:10,代码来源:hunting.py

示例10: __init__

# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
def __init__(self,**kwargs):
    for arg,default in [("white_spots",False),
                        # Set to True if spots are lighter than the
                        # surroundings, else set to False
                        ("update_thresh",False),
                        # Should the threshold be updated in each round ?
                        # lower chance to loose the spots, but more noise
                        # in the measurements
                        ("num_spots","auto"),
                        # Can be either 'auto',2,3 or 4
                        # It will help for spot detection
                        # it allows to force detection of a given number
                        # of spots (auto works fine most of the time)
                        ("safe_mode",False),
                        # If set to False, it will try hard to catch the
                        # spots when losing them.
                        # Could result in incoherent values without crash.
                        # Set it to True when security is a concern.
                        ("border",5),
                        # The number of pixel that will be added to the limits
                        # of the boundingbox
                        ("min_area",150)]:
                        # Filters regions with an area smaller than this values
                        # among the selected regions
      setattr(self,arg,kwargs.pop(arg,default))
    assert not kwargs,"Invalid kwarg in ve:"+str(kwargs)
    assert self.num_spots in ['auto',2,3,4],"Invalid number of spots!"
    self.spot_list = []
    self.fallback_mode = False
    self.consecutive_overlaps = 0
    # This number of pixel will be added to the window sending the
    # spot image to the process 
开发者ID:LaboratoireMecaniqueLille,项目名称:crappy,代码行数:34,代码来源:videoextenso.py

示例11: __init__

# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
def __init__(self):
    Process.__init__(self)
    # MasterBlock.instances.append(self)
    self.outputs = []
    self.inputs = []
    # This pipe allows to send 2 essential signals:
    # pipe1->pipe2 is to start the main function and set t0
    # pipe2->pipe1 to set process status to the parent
    self.pipe1, self.pipe2 = Pipe()
    self._status = "idle"
    self.in_process = False  # To know if we are in the process or not
    self.niceness = 0 
开发者ID:LaboratoireMecaniqueLille,项目名称:crappy,代码行数:14,代码来源:masterblock.py

示例12: __init__

# 需要导入模块: from multiprocessing import Process [as 别名]
# 或者: from multiprocessing.Process import __init__ [as 别名]
def __init__(self, iface, iface_mac, gw_ip, gw_mac, host):

        Thread.__init__(self)
        self.iface = iface
        self.iface_mac = iface_mac
        self.gw_ip = gw_ip
        self.gw_mac = gw_mac
        self.host = host
        self.vic_mac = get_mac(host) 
开发者ID:husam212,项目名称:MITMer,代码行数:11,代码来源:mitmer.py


注:本文中的multiprocessing.Process.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。