L
L
lolchik2020-07-01 18:14:18
Python
lolchik, 2020-07-01 18:14:18

How to setup os.startfile()?

there is an application that asks the user for the full path to the file and launches it via os.startfile(). It opens all programs normally except for the python console game that starts music. The game itself works as it should, without crashes, but when I open it through the program at the moment game crashes when opening .mp3 file. UPD error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc4 in position 0: invalid continuation byte

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
lolchik, 2020-07-05
@lo1chik

Solution: put all the game files in the same folder with the program. Launching through startfile () has earned.

D
Dr. Bacon, 2020-07-01
@bacon

everything that is on the startfile setup is described in the docs https://docs.python.org/3/library/os.html#os.startfile

S
soremix, 2020-07-01
@SoreMix

Are you sure there is no error in the program itself? Try opening it with subprocess
https://docs.python.org/3/library/subprocess.html#...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question