I need to: 1. Capture the output of a process in a log file, but 2. Do it detached, since the program can take hours, (or days).
Apparently, if you use QProcess.startDetached(command), you lose your StandardOutput, so that
launchApp = QtCore.QProcess()
launchApp.setStandardOutputFile("logfile")
launchSim.startDetached("my_command")
does not work.
launchSim.start("my_command")
DOES work, but I can't afford the tie-up. Also
launchSim.startDetached("my_command", " > logfile")
does not work. It sees "> logfile" as an illegal option to "my_command"
This is on Linux
The problem is that "my_command" dies when the calling program closes. nohup doesn't seem to help. (Not sure why).