I have created a script to run a test script on a batch of files,have been testing it overnight for two nights, however it just hangs at a certain point.
I was wondering if the the commands.getstatusoutput() is the issue here since the test script is has a heavy logging mechanism.
Update:
How is using subprocess module functions different from using os.system() which way of doing things is better?
The method
getstatusoutput()returns a string, which can be very long and therefore take up a lot of space and cause paging to disk and other nasty things.Since the
commandsmodule is deprecated anyway, better use thesubprocessmodule which provides a file-like access to the process output. If you need the output for later, just write it into a file on the hard diskIf you want process to process the output, read stdout like this
Which will be easier on your memory.