在 Windows 中从 Python 控制 VLC

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2564815/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 14:12:51  来源:igfitidea点击:

Control VLC from Python in Windows

pythonwindowsvlc

提问by Sridhar Ratnakumar

I'm running VLC(a media player) in Windows 7. Is there way to control (as in: play, pause, set volume) a running instance of VLC from Python?

我在 Windows 7 中运行VLC(媒体播放器)。有没有办法从 Python 控制(如:播放、暂停、设置音量)正在运行的 VLC 实例?

回答by Mauricio Scheffer

Yes, you can control it via telnet(with telnetlib). There are also libvlc bindings, but I'm not sure you can use that to control an existing VLC instance.

是的,您可以通过 telnet(使用telnetlib)控制它。还有libvlc bindings,但我不确定您是否可以使用它来控制现有的 VLC 实例。

回答by Toni Ru?a

As a general alternative to already mentioned solutions it's good to know about pywinauto

作为已经提到的解决方案的一般替代方案,最好了解pywinauto

UPDATE:

更新:

Check out swapyfor a way to with pywinauto more easily.

查看swapy以获取更轻松地使用 pywinauto 的方法。