本文整理汇总了Python中easyprocess.EasyProcess.start方法的典型用法代码示例。如果您正苦于以下问题:Python EasyProcess.start方法的具体用法?Python EasyProcess.start怎么用?Python EasyProcess.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类easyprocess.EasyProcess
的用法示例。
在下文中一共展示了EasyProcess.start方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_deadlock
# 需要导入模块: from easyprocess import EasyProcess [as 别名]
# 或者: from easyprocess.EasyProcess import start [as 别名]
def test_deadlock():
d = Display(visible=VISIBLE, size=(600, 400))
d.start()
p = EasyProcess([python, '-c', 'import Image;Image.new("RGB",(99, 99)).show()'])
p.start()
p.sleep(1)
# hangs with pipes
p.stop()
d.stop()
示例2: display
# 需要导入模块: from easyprocess import EasyProcess [as 别名]
# 或者: from easyprocess.EasyProcess import start [as 别名]
def display(self, zipfilename='', block=True):
fig = plt.figure()
self.create(fig, zipfilename)
if block:
plt.show()
else:
p = EasyProcess([sys.executable,
'-m', 'elme.start.plot',
self.project.name,
'--plot', self.name,
'--zipfilename', zipfilename
])
p.start()
示例3: start
# 需要导入模块: from easyprocess import EasyProcess [as 别名]
# 或者: from easyprocess.EasyProcess import start [as 别名]
def start(self):
'''
start display
:rtype: self
'''
EasyProcess.start(self)
# https://github.com/ponty/PyVirtualDisplay/issues/2
self.old_display_var = os.environ[
'DISPLAY'] if 'DISPLAY' in os.environ else ':0'
self.redirect_display(True)
# wait until X server is active
# TODO: better method
time.sleep(0.1)
return self
示例4: service
# 需要导入模块: from easyprocess import EasyProcess [as 别名]
# 或者: from easyprocess.EasyProcess import start [as 别名]
def service(request, service_mock):
port = random.randint(30000, 40000)
p = EasyProcess('python3.4 src/service.py {}'
'http://localhost:{}/tests/html1'
.format(port, service_mock.port))
def turn_off():
print("DOWN")
p.stop()
print("STDOUT: " + p.stdout)
print("STDERROR: " + p.stderr)
print("CODE: " + str(p.return_code))
request.addfinalizer(turn_off)
p.start()
time.sleep(0.5)
p.port = port
return p
示例5: start
# 需要导入模块: from easyprocess import EasyProcess [as 别名]
# 或者: from easyprocess.EasyProcess import start [as 别名]
def start(self):
"""
start display
:rtype: self
"""
if self.use_xauth:
self._setup_xauth()
EasyProcess.start(self)
# https://github.com/ponty/PyVirtualDisplay/issues/2
# https://github.com/ponty/PyVirtualDisplay/issues/14
self.old_display_var = os.environ.get("DISPLAY", None)
self.redirect_display(True)
# wait until X server is active
# TODO: better method
time.sleep(0.1)
return self