I cant open obs with python

kalkulator

New Member
Hi im a VERY beginer in python, but I would like to know how to execute obs with python, because I have been trying to do it but I get two errors, this is the .py that I have copied from gpt:

---------------------------------------------------------------------------
import subprocess

# Path to the .exe file you want to run
path_to_exe = r"C:\Program Files\obs-studio\bin\64bit\obs64.exe"

# Run the .exe file without running it in the background
subprocess.call(path_to_exe)

--------------------------------------------------------------------------


and when I run it I get 2 windows with 2 different errors:
1713727678269.png

1713727688322.png


when I open obs manually I do not get any error, neither from the shortcut nor from the executable itself("C:\Program Files\obs-studio\bin\64bit\obs64.exe")
 

Suslik V

Active Member
The error "Failed to find locale/en-US.ini" rises because you running executable outside of the current directory. Change current dir first.

To specify current dir for internals of subprocess.call function in Python you can try to specify cwd parameter for this function, in your case: subprocess.call(path_to_exe, cwd='C:/Program Files/obs-studio/bin/64bit/')
 
Top