本文整理汇总了Python中process.Process方法的典型用法代码示例。如果您正苦于以下问题:Python process.Process方法的具体用法?Python process.Process怎么用?Python process.Process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类process
的用法示例。
在下文中一共展示了process.Process方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_process
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def set_process(self, process = None):
"""
Manually set the parent process. Use with care!
@type process: L{Process}
@param process: (Optional) Process object. Use C{None} to autodetect.
"""
if process is None:
self.__process = None
else:
self.__load_Process_class()
if not isinstance(process, Process):
msg = "Parent process must be a Process instance, "
msg += "got %s instead" % type(process)
raise TypeError(msg)
self.dwProcessId = process.get_pid()
self.__process = process
示例2: summarize
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def summarize(self) -> Dict[int, ProcessSummary]:
summary_by_process_id = dict() # type: Dict[int, ProcessSummary]
for process_id in self.locations.keys():
locations = self.locations[process_id]
actions = self.actions[process_id]
p = Process(process_id=process_id, locations=locations, actions=actions,
num_steps=self.num_sentences[process_id])
summary_by_process_id[p.process_id] = ProcessSummary(
process_id=p.process_id,
inputs=p.inputs(),
outputs=p.outputs(),
conversions=p.conversions(),
moves=p.moves(),
)
return summary_by_process_id
示例3: diff_participants
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def diff_participants(self, other: "ActionFile") -> List[str]:
report: List[str] = []
for process_id in self.process_ids():
self_participants = self.participants(process_id)
if not other.has_process_id(process_id):
report.append(f"Process {process_id} missing in {other.filename}")
continue
other_participants = other.participants(process_id)
process_report: List[str] = []
for p in self_participants:
if p not in other_participants:
process_report.append(f"Process {process_id} in {other.filename}: participant \"{p}\" is missing.")
for op in other_participants:
if op not in self_participants:
process_report.append(
f"Process {process_id} in {other.filename}: participant \"{op}\" is unexpected.")
report += sorted(process_report)
return report
示例4: __init__
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def __init__(self, hWnd = None, process = None, thread = None):
"""
@type hWnd: int or L{win32.HWND}
@param hWnd: Window handle.
@type process: L{Process}
@param process: (Optional) Process that owns this window.
@type thread: L{Thread}
@param thread: (Optional) Thread that owns this window.
"""
self.hWnd = hWnd
self.dwProcessId = None
self.dwThreadId = None
self.set_process(process)
self.set_thread(thread)
示例5: __load_Process_class
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def __load_Process_class(self):
global Process # delayed import
if Process is None:
from process import Process
示例6: get_process
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def get_process(self):
"""
@rtype: L{Process}
@return: Parent Process object.
"""
if self.__process is not None:
return self.__process
self.__load_Process_class()
self.__process = Process(self.get_pid())
return self.__process
示例7: __get_window
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def __get_window(self, hWnd):
"""
User internally to get another Window from this one.
It'll try to copy the parent Process and Thread references if possible.
"""
window = Window(hWnd)
if window.get_pid() == self.get_pid():
window.set_process( self.get_process() )
if window.get_tid() == self.get_tid():
window.set_thread( self.get_thread() )
return window
#------------------------------------------------------------------------------
示例8: is_debugee_started
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def is_debugee_started(self, dwProcessId):
"""
Determine if the given process was started by the debugger.
@see: L{is_debugee}, L{is_debugee_attached}
@type dwProcessId: int
@param dwProcessId: Process global ID.
@rtype: bool
@return: C{True} if the given process was started for debugging by this
L{Debug} instance.
"""
return dwProcessId in self.__startedDebugees
示例9: is_debugee_attached
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def is_debugee_attached(self, dwProcessId):
"""
Determine if the debugger is attached to the given process.
@see: L{is_debugee}, L{is_debugee_started}
@type dwProcessId: int
@param dwProcessId: Process global ID.
@rtype: bool
@return: C{True} if the given process is attached to this
L{Debug} instance.
"""
return dwProcessId in self.__attachedDebugees
示例10: force_garbage_collection
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def force_garbage_collection(bIgnoreExceptions = True):
"""
Close all Win32 handles the Python garbage collector failed to close.
@type bIgnoreExceptions: bool
@param bIgnoreExceptions: C{True} to ignore any exceptions that may be
raised when detaching.
"""
try:
import gc
gc.collect()
bRecollect = False
for obj in list(gc.garbage):
try:
if isinstance(obj, win32.Handle):
obj.close()
elif isinstance(obj, Event):
obj.debug = None
elif isinstance(obj, Process):
obj.clear()
elif isinstance(obj, Thread):
obj.set_process(None)
obj.clear()
elif isinstance(obj, Module):
obj.set_process(None)
elif isinstance(obj, Window):
obj.set_process(None)
else:
continue
gc.garbage.remove(obj)
del obj
bRecollect = True
except Exception, e:
if not bIgnoreExceptions:
raise
warnings.warn(str(e), RuntimeWarning)
if bRecollect:
gc.collect()
示例11: createProcess
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def createProcess(self, encoding = None):
return Process(self.window, encoding)
# 套接字服务端
示例12: enque_file
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def enque_file(self, file_name):
cmd_list = [line.rstrip('\n') for line in open(file_name)]
for cmd in cmd_list:
broken_up_cmd = cmd.split()
self.pl.append(process.Process(broken_up_cmd))
示例13: spawnProcess
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def spawnProcess(self, processProtocol, executable, args=(), env={}, path=None, usePTY=0):
"""Spawn a process."""
return process.Process(self, processProtocol, executable, args, env, path)
示例14: spawnProcess
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def spawnProcess(self, processProtocol, executable, args=(),
env={}, path=None,
uid=None, gid=None, usePTY=0, childFDs=None):
if platformType == 'posix':
if usePTY:
if childFDs is not None:
raise ValueError("Using childFDs is not supported with usePTY=True.")
return process.PTYProcess(self, executable, args, env, path,
processProtocol, uid, gid, usePTY)
else:
return process.Process(self, executable, args, env, path,
processProtocol, uid, gid, childFDs)
elif platformType == "win32":
if uid is not None or gid is not None:
raise ValueError("The uid and gid parameters are not supported on Windows.")
if usePTY:
raise ValueError("The usePTY parameter is not supported on Windows.")
if childFDs:
raise ValueError("Customizing childFDs is not supported on Windows.")
if win32process:
from twisted.internet._dumbwin32proc import Process
return Process(self, processProtocol, executable, args, env, path)
else:
raise NotImplementedError, "spawnProcess not available since pywin32 is not installed."
else:
raise NotImplementedError, "spawnProcess only available on Windows or POSIX."
# IReactorUDP
示例15: __init__
# 需要导入模块: import process [as 别名]
# 或者: from process import Process [as 别名]
def __init__(self):
super(GUI,self).__init__()
self.initUI()
self.webcam = Webcam()
self.video = Video()
self.input = self.webcam
self.dirname = ""
print("Input: webcam")
self.statusBar.showMessage("Input: webcam",5000)
self.btnOpen.setEnabled(False)
self.process = Process()
self.status = False
self.frame = np.zeros((10,10,3),np.uint8)
#self.plot = np.zeros((10,10,3),np.uint8)
self.bpm = 0