-3

I want to play a MP4 Named startup.mp4 fullscreen. I've tried this code :

from os import startfile

startfile("C:/Users/idekmauser/desktop/startup.mp4")

It does play but not fullscreen how can I make it play fullscreen

  • 2
    Can you format the question with the code indented, you can do it by highlight the code and pressing ctrl + k. – Nhyi Jul 07 '21 at 13:03
  • 4
    This is not how one defines a function with one argument. Also, `C:\Users\idekmauser\desktop\startup.mp4` is _not_ a string. Please take [a tutorial](https://docs.python.org/3/tutorial/index.html) first. – ForceBru Jul 07 '21 at 13:06

2 Answers2

1

You Must Give The Directory As A String Like This
"C:\Users\idekmauser\desktop\startup.mp4"
and not this
C:\Users\idekmauser\desktop\startup.mp4
And You Can Run Your MP4 With This Snippet

from os import startfile
startfile(r"C:\Users\idekmauser\desktop\startup.mp4")

For Reference: [os.startfileDocs] [StackOverflow]

Manoj A
  • 424
  • 2
  • 5
  • 13
  • This error occurs because you are using a normal string as a path. Just put r before that.. and I also edited in the answer too startfile(r"C:\Users\idekmauser\desktop\startup.mp4") – Manoj A Jul 07 '21 at 13:33
0

The error is caused by i guess you adding C:\Users\idekmauser\desktop\startup.mp4 in the begning of the file which is not a string

Your code should look something like this

from os import startfile

def play_movie():
    startfile("C:/Users/idekmauser/desktop/startup.mp4")

play_movie()

Otherwise to play sounds you can use a Library like playsound

So you start by first installing it

pip3 install playsound

After that your code should look something like this

from playsound import playsound

playsound("C:/Users/idekmauser/desktop/startup.mp4")