I created a script to run a script test in a package of files, tested it overnight for two nights, however it just freezes at some point.
I was wondering if the command.getstatusoutput () problem is here, since the test script has a heavy logging mechanism.
Update:How is using subprocess module functions different from using os.system (), what is the best way to do things?
getstatusoutput() , , , .
getstatusoutput()
commands , , subprocess, . ,
commands
subprocess
cmd = subprocess.Popen(['ls'], stdout=file('output', 'w'))
, , stdout,
cmd = subprocess.Popen(['ls'], stdout=subprocess.PIPE) for line in cmd.stdout: do_stuff(line)
.
Source: https://habr.com/ru/post/1734078/More articles:How to remove all events from the application event log for only one source? - c #Rails global content_for - optimizationSorting a list from an Arrays.asList () array also changes the original array? - javaСоздание физической памяти из пользовательского пространства для использования для передачи DMA - memory-managementWhat is the best way to prevent customers from evaluating a product more than once? - ratingC (++) malloc confusion - c ++Can I disable E_STRICT for library code, but not my code? - phpDetermine dates by number of days, "which date is 180 days - datetimeCode Golf: C #: convert ulong to hexadecimal string - c #Internet Based Musical and Sound Synthesis - Overview - javascriptAll Articles