Use EG action to execute an existing .py script

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
williamp0044
Posts: 2
Joined: Thu Jul 28, 2011 5:12 pm

Use EG action to execute an existing .py script

Post by williamp0044 » Thu Jul 28, 2011 5:20 pm

Hi all,
Just wondering if there is a way that I can go about executing a Python program/script/.py file after an action is triggered in EventGhost? Similar to the System Execute plugin. I've tried several options with the Python Command and Python Script plugins but my knowledge on the language is limited and the python program does not have a .exe file. The interpreter is installed and I can run the program under normal conditions but I'd liked to incorporate it into an EventGhost script.

Thanks in advance.

cfull1
Experienced User
Posts: 124
Joined: Thu Aug 19, 2010 4:52 am

Re: Use EG action to execute an existing .py script

Post by cfull1 » Thu Sep 01, 2011 9:18 pm

Have you tried using a batch file?
python script:

Code: Select all

eg.plugins.System.Execute(batch file, options, 1, False, 2, directory, False)
batch file:

Code: Select all

@echooff
file.py

Mama70
Posts: 5
Joined: Sun Dec 18, 2011 10:28 am

Re: Use EG action to execute an existing .py script

Post by Mama70 » Sun Dec 18, 2011 2:46 pm

Create Python Command action and set it: execfile("file.py")

Post Reply