在后台启动进程并检索输出(Launch process in background and retrieve output)
我想在后台启动Flask应用程序的实例,这样我就可以对它运行webdriver测试了。 为此我需要捕获
&
命令的输出,这样我就可以在测试结束时终止进程。我已经尝试过
subprocess.call()
和subprocess.check_output()
但是我无法捕获第一个进程号或后者进程与另一个进程。 我还能尝试什么?I want to launch an instance of my Flask app in the background so I can run webdriver tests on it. For that I need to catch the output of the
&
command so I can kill the process when the test ends.I've tried
subprocess.call()
, andsubprocess.check_output()
but I can't catch the process number of the first or background the process with the other. What else can I try?
原文:https://stackoverflow.com/questions/36460482
更新时间:2022-04-01 08:04
最满意答案
Template.videoControls.events({ 'click button#play-pause': function(event) { var video = document.getElementById("video"); var playButton = document.getElementById("play-pause"); var seekBar = document.getElementById("seek-bar"); // Event listener for the seek bar seekBar.addEventListener("change", function() { // Calculate the new time var time = video.duration * (seekBar.value / 100); // Update the video time video.currentTime = time; }); // Update the seek bar as the video plays video.addEventListener("timeupdate", function() { // Calculate the slider value var value = (100 / video.duration) * video.currentTime; // Update the slider value seekBar.value = value; }); if (video.paused == true) { video.play(); playButton.innerHTML = "Pause"; } else { video.pause(); playButton.innerHTML = "Play"; } },
Template.videoControls.events({ 'click button#play-pause': function(event) { var video = document.getElementById("video"); var playButton = document.getElementById("play-pause"); var seekBar = document.getElementById("seek-bar"); // Event listener for the seek bar seekBar.addEventListener("change", function() { // Calculate the new time var time = video.duration * (seekBar.value / 100); // Update the video time video.currentTime = time; }); // Update the seek bar as the video plays video.addEventListener("timeupdate", function() { // Calculate the slider value var value = (100 / video.duration) * video.currentTime; // Update the slider value seekBar.value = value; }); if (video.paused == true) { video.play(); playButton.innerHTML = "Pause"; } else { video.pause(); playButton.innerHTML = "Play"; } },
相关问答
更多-
如何显示进度条,直到视频在Android直播流中播放?(How to show progress bar until video play in live stream Android?)[2023-04-12]
看看这个解决了我的问题希望你也帮助你.. http://www.quicktips.in/how-to-show-progressbar-while-loading-a-video-in-android-videoview/ progressbar.setVisibility(View.VISIBLE); videoView.setOnPreparedListener(new OnPreparedListener() { @Override publi ... -
您可以通过使用setInterval每15 millisecond增加其value并且如果该value大于使用clearInterval percentage ,则停止递增。 此代码提取当前value并将其递增,直至达到percentage值。 注意: percentage手动设置为70 。 var progressBar = document.getElementById('video-progress'); function updateProgressBar() { var percent ...
-
我必须尝试在RunOnUiThread,RunOnUiThread或Handler.Post中运行设置进度,但是当我必须在我的方法中循环时。 它使进度条没有更新。 有人能帮我吗? 这听起来像你正试图在UI线程中执行循环方法,这将解释在循环期间栏不改变值。 尝试在新的/不同的线程中运行你的方法。 请参阅类似问题的链接。 I have to try run set progress in RunOnUiThread, RunOnUiThread, or Handler.Post but when I have ...
-
我如何更新进度条?(How can I update a progress bar?)[2023-12-19]
您正在寻找的信息是PBM_SETPOS 。 这种用法取决于当前设置的范围(默认值为0-100)。 例如,假设默认范围,将位置设置为一半将按如下方式完成: SendMessage(hProgress, PBM_SETPOS, 50, 0); 或者,可以通过PBM_STEPIT逐步增加进度栏。 这个用法取决于步增量(默认为10)。 例如,假设进度条的默认范围和初始位置,将位置移动到10将按如下方式完成: SendMessage(hProgress, PBM_STEPIT, 0, 0); The messag ... -
1.创建新的视图控件 2.将你的videoarray1值传递给nextvieww控件我的意思是你的视频网址 3.add代码nextview控件 - (void)viewDidLoad { [super viewDidLoad]; self.indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; self.in ...
-
花了很多时间后,我发现使用我当前的代码是不可能的。 由于我们使用Web视图加载HTML页面,现在我们使用插件在HTML页面中播放视频。 在那里,我能够实现这个所需的功能。 After spending large amount of time, I found that it is not possible with my current code. Since we are using Web view to load HTML pages, now we are using plugin to play ...
-
Template.videoControls.events({ 'click button#play-pause': function(event) { var video = document.getElementById("video"); var playButton = document.getElementById("play-pause"); var seekBar = document.getElementById("seek-bar") ...
-
这是因为percentComplete必须是介于0和1之间的数字。如果使用的数字大于1,它将计为100%。 在编程中,这种行为被广泛使用,例如, 50%仅为50/100 = 0.5 。 That's because percentComplete must be a number between 0 and 1. If you use more than 1 it will count as 100%. In programming this behavior is widely used, as 50% ...
-
视频无效的进度条(progress bar for video not working)[2023-07-11]
你需要用e.offsetX替换你的e.pageX-bar.offsetLeft,这应该可行。 甚至在您尝试更改代码之前,请先了解screenX / Y,clientX / Y,pageX / Y和offsetX / Y与pageX / Y之间的差异。 You need to replace your e.pageX-bar.offsetLeft with e.offsetX and this should work. Even before you attempt to change the code, u ... -
使用属性和样式绑定:
相关文章
更多- 干干净净终结进程[转] Terminate process cleanly [reprint]
- 解决Hadoop抛出的Task process exit with nonzero status of 134异常
- Hadoop运行时错误:Task process exit with nonzero status of 1
- zz Data Analysis Process
- javax.imageio.IIOException: Can't create output stream!的解决方案
- 启动Storm各个后台进程
- Hadoop执行分布式Process
- multi-core solr deploy process(not complete)
- multi-core solr deploy process(not complete)
- Storm启动流程简介
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。