And it doesn't look like you need a shell at all. That is, you create pipes, and then just reprint to stdout with your own message. You also don't really need to use Popen as you're not really using its features. Presumably perl is not closing stdout as it's leaving it open for it's own subprocess to write to. Communicate is explicitly designed to wait until the stdout of the process has closed. Print 'This line is printed only when the GUI process is terminated.'ĭon't use communicate. My "General Tool" last Main lines (Written in Perl): if ($args->'.format(exit_code, stdout) I need municate() to return once the main process is terminated, and not to wait for the subprocesses that run on the background. I have to manually close the GUI (which is a subprocess that runs on the BG), so municate() returns. The problem is that municate() continues waiting to the process, although it's already terminated. My "general tool" runs for ~1 second, loads the GUI process on the background and exits immediately. I call my "general tool" from a Python script, using Popen and municate() method. I work in Unix, and I have a "general tool" that loads another process (GUI utility) on the background, and exits.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |