0

I am using windows 10 64-bit system. I want to play a video in vlc media player using python2.7. I have implemented this code: import subprocess import os

p = subprocess.Popen(["C:/Program Files/VideoLAN/VLC/vlc.exe","F:/abacus.mp4"]) 

But on executing the above code, only vlc player get started but does not play that abacus.mp4 video. I have also tried this:

p = subprocess.Popen([os.path.join("C:/", "Program Files", "VideoLAN", "VLC", "vlc.exe"),os.path.join("F:/", "abacus.mp4")]) 

But unfortunately, I am getting the same result. Please let me know if anyone could help me on this. Thanks in advance.

3 Answers 3

1

Why don't you simply use os module and use its popen?

This works for me:

 import os os.popen("C:/Program Files/VideoLAN/VLC/vlc.exe F:/abacus.mp4") 
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the reply. But its not working for me. When I run from cmd, Its gets executed without any errors , but nothing happens after that, I mean vlc does not pops up play the required video. And when I run from pythonWin, it is showing the following error:
<open file 'C:/Program Files/VideoLAN/VLC/vlc.exe F:/abacus.mp4', mode 'r' at 0x02CC5180>
0

Edit your code as follows :-

p = subprocess.Popen(["C:\\\Program Files\\\VideoLAN\\\VLC\\\vlc.exe","F:\\\abacus.mp4"]) 

Comments

0

This worked for me (for a different but related case):

p = subprocess.Popen(["C:/ProgramFiles/VideoLAN/VLC/vlc.exe","file:///F:/abacus.mp4]) 

Hope it helps.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.