RasPi 3 Python: why does Popen break out my while loop?Debian/LXDE terminal, how to disable it/disable the panel barWhat does “SyntaxError: Missing parentheses in call to 'print'” mean in Python?Why is “1000000000000000 in range(1000000000000001)” so fast in Python 3?Why does “not(True) in [False, True]” return False?Python3.4 - How do I get the PID of a program that was started with Popen? (OS -Raspbian Jessie)TkInter Frame doesn't load if another function is calledBreak out of if while loop in pythonRasPi Python - ModuleNotFoundError: No module named 'tornado'Omxplayer-wrapper problems when run from terminalHow to play a shuffled list of videos in omxplayer
Why would image resources loaded from different origins triggering HTTP authentication dialogs be harmful?
Was the lunar landing site always in the same plane as the CM's orbit?
Is there a neutral term for people who tend to avoid face-to-face or video/audio communication?
Dissuading my girlfriend from a scam
Male viewpoint in an erotic novel
Fantasy Military Arms and Armor: the Dwarven Grand Armory
I won a car in a poker game. How is that taxed in Canada?
Are there mathematical concepts that exist in the fourth dimension, but not in the third dimension?
What are some countries where you can be imprisoned for reading or owning a Bible?
Do 643,000 Americans go bankrupt every year due to medical bills?
Existence of a Hölder-free space
Remaining in the US beyond VWP admission period
How do I make my fill-in-the-blank exercise more obvious?
Why does the seven segment display have decimal point at the right?
extract specific cheracters from each line
Why did Boris Johnson call for new elections?
Can you create water inside someone's mouth?
How do I use NEC PC-6001 .p6 or .cas files?
Is there some sort of French saying for "a person's signature move"?
Book where main character comes out of stasis bubble
Why did Tony's Arc Reactor do this?
Pronounceable encrypted text
What are the map units that WGS84 uses?
How do I anonymously report the Establishment Clause being broken?
RasPi 3 Python: why does Popen break out my while loop?
Debian/LXDE terminal, how to disable it/disable the panel barWhat does “SyntaxError: Missing parentheses in call to 'print'” mean in Python?Why is “1000000000000000 in range(1000000000000001)” so fast in Python 3?Why does “not(True) in [False, True]” return False?Python3.4 - How do I get the PID of a program that was started with Popen? (OS -Raspbian Jessie)TkInter Frame doesn't load if another function is calledBreak out of if while loop in pythonRasPi Python - ModuleNotFoundError: No module named 'tornado'Omxplayer-wrapper problems when run from terminalHow to play a shuffled list of videos in omxplayer
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I wanted to play two videos with each command and try to stop them also, but as i run the code, it plays but the while loop ends or the whole program is killed.
This is the code:
import os
import sys
from time import sleep
from subprocess import Popen
movie1 = ("/home/pi/Downloads/movie1.mp4")
movie2 = ("/home/pi/Downloads/movie2.mp4")
def vPlay(video):
os.system('killall omxplayer.bin')
omxc = Popen(['omxplayer', '-b', video])
sleep(1)
if __name__ == "__main__":
while True:
print("Command:")
x = input()
if x == 'q':
vPlay(movie1)
omxc = Popen(['omxplayer','i'])
elif x == 'w':
vPlay(movie2)
omxc = Popen(['omxplayer','i'])
elif x == 'e':
os.system('killall omxplayer.bin')
This is the Terminal:
>>> %Run sys.py
Command:
q
omxplayer.bin: no process found
Command:
========================= RESTART =========================
>>>
Please help me find some solution for this problem. Thank You
python-3.x raspberry-pi3 raspbian
add a comment |
I wanted to play two videos with each command and try to stop them also, but as i run the code, it plays but the while loop ends or the whole program is killed.
This is the code:
import os
import sys
from time import sleep
from subprocess import Popen
movie1 = ("/home/pi/Downloads/movie1.mp4")
movie2 = ("/home/pi/Downloads/movie2.mp4")
def vPlay(video):
os.system('killall omxplayer.bin')
omxc = Popen(['omxplayer', '-b', video])
sleep(1)
if __name__ == "__main__":
while True:
print("Command:")
x = input()
if x == 'q':
vPlay(movie1)
omxc = Popen(['omxplayer','i'])
elif x == 'w':
vPlay(movie2)
omxc = Popen(['omxplayer','i'])
elif x == 'e':
os.system('killall omxplayer.bin')
This is the Terminal:
>>> %Run sys.py
Command:
q
omxplayer.bin: no process found
Command:
========================= RESTART =========================
>>>
Please help me find some solution for this problem. Thank You
python-3.x raspberry-pi3 raspbian
add a comment |
I wanted to play two videos with each command and try to stop them also, but as i run the code, it plays but the while loop ends or the whole program is killed.
This is the code:
import os
import sys
from time import sleep
from subprocess import Popen
movie1 = ("/home/pi/Downloads/movie1.mp4")
movie2 = ("/home/pi/Downloads/movie2.mp4")
def vPlay(video):
os.system('killall omxplayer.bin')
omxc = Popen(['omxplayer', '-b', video])
sleep(1)
if __name__ == "__main__":
while True:
print("Command:")
x = input()
if x == 'q':
vPlay(movie1)
omxc = Popen(['omxplayer','i'])
elif x == 'w':
vPlay(movie2)
omxc = Popen(['omxplayer','i'])
elif x == 'e':
os.system('killall omxplayer.bin')
This is the Terminal:
>>> %Run sys.py
Command:
q
omxplayer.bin: no process found
Command:
========================= RESTART =========================
>>>
Please help me find some solution for this problem. Thank You
python-3.x raspberry-pi3 raspbian
I wanted to play two videos with each command and try to stop them also, but as i run the code, it plays but the while loop ends or the whole program is killed.
This is the code:
import os
import sys
from time import sleep
from subprocess import Popen
movie1 = ("/home/pi/Downloads/movie1.mp4")
movie2 = ("/home/pi/Downloads/movie2.mp4")
def vPlay(video):
os.system('killall omxplayer.bin')
omxc = Popen(['omxplayer', '-b', video])
sleep(1)
if __name__ == "__main__":
while True:
print("Command:")
x = input()
if x == 'q':
vPlay(movie1)
omxc = Popen(['omxplayer','i'])
elif x == 'w':
vPlay(movie2)
omxc = Popen(['omxplayer','i'])
elif x == 'e':
os.system('killall omxplayer.bin')
This is the Terminal:
>>> %Run sys.py
Command:
q
omxplayer.bin: no process found
Command:
========================= RESTART =========================
>>>
Please help me find some solution for this problem. Thank You
python-3.x raspberry-pi3 raspbian
python-3.x raspberry-pi3 raspbian
asked Mar 28 at 4:33
cazmocazmo
11 bronze badge
11 bronze badge
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55390221%2fraspi-3-python-why-does-popen-break-out-my-while-loop%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55390221%2fraspi-3-python-why-does-popen-break-out-my-while-loop%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown