直接外部传入参数:
import subprocess import os def compile(sdk, mainPath, configPath=None, callback=None): os.chdir(sdk + "/bin/") cmdName = ‘mxmlc‘ args = cmdName + " " + mainPath + " " if configPath: f = open(configPath) conf = f.read() conf = conf.replace("\r", "") conf = conf.replace("\n", " ") args += conf print args sp = subprocess.Popen(args) sp.wait() if callback: callback()
配置文件的参数见 application compiler options
时间: 2024-11-13 11:03:13