[Tutor] vlc media player in python
Cameron Simpson
cs at cskk.id.au
Mon Dec 30 18:16:52 EST 2019
On 24Dec2019 22:00, Aleksa <mi8k0mi at gmail.com> wrote:
>Please, how to set vlc media player to work in Python.I know it has a
>python-vlc module ,But to have all the settings in python not just
>calling to the path for vlc
I presume you mean this:
https://pypi.org/project/python-vlc/
That requires the VLC programme to be already installed on your
computer. Is it?
>playlist = ['/path/to/song1.flac', '/path/to/song2.flac', 'path/to/song3.flac']
>for song in playlist:
> player = vlc.MediaPlayer(song)
> player.play()
You will need an import statement at the top of you code:
import vlc
in order to obtain the "vlc" name.
If that is still failing, please reply including the output of a failing
run (paste the output inline in your reply message, do not attach an
image or anything like that).
Also note that the paths in your code '/path/to/song1.flac' etc are
obviously examples from somewhere; they will need to be real pathnames
of real files.
Cheers,
Cameron Simpson <cs at cskk.id.au>
More information about the Tutor
mailing list