Well, I replaced L509 to L520 (the `if notebook` block) with `ip_app.exec_lines = [preexec_source]` and I deleted the pid/os.fork stuff above, leaving the `App` import (so it would work on Windows) and it seemed to work.