當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。