Running a python script with Command as source but rule doesn’t end
Q: I’m trying to setup a rule with a cmd as source, it executes a python script. When I execute the rule, it works well (I have the expected result), but the rule doesn’t end. So, I don’t have any output in the Limagito GUI.
It seems that the process continues to run :
20/01/2025 12:08:02 Execute Rule Request from administrator at 192.168.92.38 []
20/01/2025 12:08:02 Execute Command as Source: [CMD] Command, Command Line: CMD /C python xxx\mediaprint_api_v3.py
20/01/2025 12:08:02 Set CMD as Source Output to C:\Users\ADMINI~1\AppData\Local\Temp\LimagitoX\LimagitoX.83\
20/01/2025 12:08:02 Execute M1 Command, Exception Error: Cannot perform this operation when process is running
20/01/2025 12:08:02 Execute Command as Source Succes, ExitCode : 4294967295, Result Path: C:\Users\ADMINI~1\AppData\Local\Temp\LimagitoX\LimagitoX.83\
20/01/2025 12:08:07 Rule Disabled by administrator at 192.168.92.38 []
Should I check an option when configuring the rule to avoid that ?
A: You are using CMD /C so that part is OK. I guess you need to add something to the python script that will close afterwards.
ChatGPT info:

Customer feedback:
Indeed, i was trying things and I it ended successfully with a sys.exit(0)
If you need any help with this ‘Running a python script’ question, please let us know.
Best Regards,
Limagito Team
#python #managedfiletransfer #filetransfer #filemanagement