-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
  • 2
    Can you format the question with the code indented, you can do it by highlight the code and pressing ctrl + k. Commented Jul 7, 2021 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 first. Commented Jul 7, 2021 at 13:06

2 Answers 2

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]

Sign up to request clarification or add additional context in comments.

1 Comment

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")
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") 

7 Comments

Sorry instead of \ you have to use / i forgot to change it. Because otherwise it is going to count as a unicode escape character
No problems, i changed and it should work now
You can look at this question maybe that would be of help stackoverflow.com/questions/50718126/…
Ypu have to install the library by pip install win32gui
Hahahah no worries we all have been there but no with the command prompt
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.