Run Executable Inside Zeus Using Python

This forum allows you to share scripts with other Zeus users. Please do not post bug reports, feature requests or questions to this forum, but rather use it exclusively for posting scripts or for the discussion of scripts that have been posted.
Post Reply
Site Admin
Posts: 2547
Joined: Fri Aug 13, 2004 5:10 pm

Run Executable Inside Zeus Using Python

Post by jussij »

Code: Select all

#        Name: Process
#  Decription: Run a executable inside Zeus using Python and capture
#              the output.

import os
import zeus
import subprocess

def key_macro():

   # set the current directory

   # initialise the startup info to run hidden
   info = subprocess.STARTUPINFO()
   info.dwFlags |= subprocess.STARTF_USESHOWWINDOW
   info.wShowWindow = subprocess.SW_HIDE

   # run a command and capture the output
   p = subprocess.Popen(["cmd.exe", "/k", "dir *.*"], stdout=subprocess.PIPE, startupinfo=info)
   result =

   # display the output
   zeus.message_box(0, result, "Python Process Output")

key_macro() # run the macro
Post Reply