Pymel / Python Coding

Run Command Line / .exe from Maya

I use midicsv, so for convenience I coded this up to run its command line from within maya gui. you run it , you pick input file, in this case a midi file (.mid) it does its thing and outputs a .csv file with the same name.

import subprocess
import EasyDialogs
input_file = EasyDialogs.AskFileForOpen()
wanted=unicode
executable_name = "C:/midicsv-1.1/midicsv.exe"
inputtext = os.path.basename(input_file)
outputtext = os.path.splitext(inputtext)[0] + ".csv"
subprocess.call([str(executable_name), str(inputtext), str(outputtext)])

Comments are closed.