Python Script wont start properly on obs

juhopelts

New Member
Hi,

I've created a small Python program (OBS_Python.py), and you can find the attached files.

The program is designed to move mp4 files from the C drive to another drive when a game is opened + to specific folder named after the game.

However, I'm facing an issue: it only prints the message 'Script Started,' and then nothing happens. This script works perfectly when I open it separately with Python 3.6.6. It's worth noting that I'm using the same Python executable that OBS uses.

Here is the script log from OBS:

[OBS_Python.py] Script Started

I've also created a program to check if psutil is working correctly.

Here is the script log from OBS:

[psutilcheck.py] First process: {'name': 'System Idle Process', 'pid': 0}

[psutilcheck.py] Memory info: Total=34270167040, Available=25819340800, Percent=24.7

[psutilcheck.py] psutil works!

Could you please help me troubleshoot this issue?
 

juhopelts

New Member
psutilcheck.py
import psutil
try:
# Hae käynnissä olevien prosessien lista
process_list = list(psutil.process_iter(['pid', 'name']))
# Tulosta ensimmäisen prosessin tiedot
if process_list:
first_process = process_list[0]
print(f"First process: {first_process.info}")
else:
print("Ei käynnissä olevia prosesseja.")
# Tulosta muisti-info
memory_info = psutil.virtual_memory()
print(f"Memory info: Total={memory_info.total}, Available={memory_info.available}, Percent={memory_info.percent}")
print("psutil toimii!")
except Exception as e:
print(f"Virhe: {e}")
 
Top