Subj : Re: Python help... To : Dr. What From : paulie420 Date : Sun Sep 06 2020 13:48:27 DW> Not part of your question, but I don't see the reason to get the video DW> list all the time, then go through the video list to get the last one to DW> play. DW> DW> I suggest putting this code outside the While loop. Then when the DW> button is pressed, just pick a random number and play the video at that DW> location in the list of videos. Thanks, that is good information and a suggestion that I can actually understand and implement. I get it. DW> os.system runs a command, then waits for it to complete before DW> continuing. DW> DW> So, if you want the button to be deactivated while the video is playing, DW> then os.system is the way to go. DW> DW> subprocess.Popen is used to execute a process, but makes it easier for DW> you to communicate with the subprocess. But it also allows you to run DW> the process in the "background" (i.e. once you run it, it returns DW> immediately - but now you have to manage the process, poll it DW> periodically, etc.) DW> DW> IHMO, unless you are already very familiar with Linux and subproceses, I DW> suggest DW> that you do not use this. Well, ok... I might have to learn about subprocesses; because the subprocess.Popen sounds like the way to go. Also, sounds like by polling and whatnot I could pass further commands to omxplayer WHILE the video is running. (Like q, quit, fastforward, etcetc...) Anyway, the Popen sounds like it would fit me more - but is a higher knowledge function. I'm gonna have to learn sometime.. thanks for explaining it a BIT anyway. DW> pa> but #didnt work YET. The os.system does play a video... just waits DW> pa> there before #listening again for a button press. DW> DW> Then the issue is with omxplayer. It's not exiting when it's done DW> playing the video. No, it exits when done... I just want to be able to push the button again before its done. I did figure it out, a different way which I'll try to post here shortly. :P DW> Thanks, Dr What. I appreciate your post. |07p|15AULIE|1142|07o |08......... --- Mystic BBS v1.12 A45 2020/02/18 (Raspberry Pi/32) * Origin: 2o fOr beeRS bbs>>>20ForBeers.com:1337 (1337:3/129) .