hello everybody,
I am somewhat confused about the number of ways you can run an
external program from python/pylons.
I need my app to be able to compile and run a performance test. then
gather the results and display the results in a relevant way. the
tests are written in autoHotKey which is a windows scripting program.
so to run a test all i need to do is call the file from the command
line.
I have a controller that kicks off the test using the subprocess
module.
class PerformancetestrunnerController(BaseController):
def index(self):
self.compileTest('/perfTests/fx-quick-trade-verify.mako')
self.runTest('fx-quick-trade-verify.ahk')
return 'run'
def compileTest(self, testPath):
c.loopCount = 10
c.GBPUSD_buyButton = '100, 100';
render(testPath)
f = open('fx-quick-trade-verify.ahk', 'w')
f.write( render(testPath) )
f.close()
def runTest(self, testPath):
path = os.path.join('C:','Program
Files','AutoHotkey','AutoHotkey.exe')
process = subprocess.Popen([path, testPath])
This does start the test running, but the page does not finish loading
until the tests have finished.
the tests themselves can call back to the pylons app to record cpu and
memory metrics.
I guess there must be a NO_WAIT flag or something i can put in to
achieve my goal.
This page (http://docs.python.org/library/subprocess.html) suggests
pid = Popen(["/bin/mycmd", "myarg"]).pid
As a no_wait example, but that didn't work for me either.
if any one has any ideas how i can achieve this, i await with baited
breath.
thanks
toby
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---