Hi,
I'm glad to hear that the shortcut helps :)
As for automatic restart. This is currently not possible. It would possibly be
problematic, e.g. imagine providing a wrong path to the Python interpreter and
Pyzo constantly trying to launch it.
Usually, when you work with script that exit in this way, you can also use
run-as-script (Ctrl-shift-e), which will also automatically restart the kernel,
so you won't even need to Ctrl-k.
Best,
Almar
On Tue, Apr 6, 2021, at 20:20, Matt Wilkie wrote:
> I found the Ctrl-K restart kernel keyboard shortcut, which makes this a much
> smaller issue.
>
> On Tuesday, April 6, 2021 at 11:02:02 a.m. UTC-7 Matt Wilkie wrote:
>> Hi,
>>
>> I'm working with a bunch of scripts from a 3rd party that often include
>> sys.exit() blocks like the below. Is there way to get the kernel to
>> automatically restart so I don't have to do that? Perhaps only after a
>> specific exit code? I'm having to reboot the kernel every minute or so while
>> going through the work and it's very repetitive.
>>
>> if len(sys.argv) < 4:
>> print(f"Usage: {sys.argv[0]} [in_file] [band#] [out_file] [band #]")
>> sys.exit(1)
>>
>> [...]
>>
>> if dataset is None:
>> print("Unable to open", input, "for reading")
>> sys.exit(1)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Pyzo" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pyzo/4a81995d-c0fc-48a7-bb1f-2c887ac56473n%40googlegroups.com
>
> <https://groups.google.com/d/msgid/pyzo/4a81995d-c0fc-48a7-bb1f-2c887ac56473n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
You received this message because you are subscribed to the Google Groups
"Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web, visit
https://groups.google.com/d/msgid/pyzo/671410ab-9c06-4f3d-a289-e94079d8087d%40www.fastmail.com.