stop python in terminal on mac

前端 未结 2 1426
闹比i
闹比i 2021-01-03 22:19

Using python in terminal on a Mac, type

ctrl-z

will stop the python, but not exit it, giving output like this:

>>>         


        
2条回答
  •  悲哀的现实
    2021-01-03 23:10

    CTRL+d -> Defines EOF (End of File).

    CTRL+c -> Will terminate most jobs.

    If, however you have written a python wrapper program that calls other python programs in turn, Ctrl-c will only stop the the job that is currently running. The wrapper program will keep running. Worst case scenario, you can do this:

    Open up: Applications -> Utilities -> Activity Monitor, Find the process labeled as python, highlight it in the activity monitor then click on "Quit Process".

    These three suggestions should work for most situations where you want a program to stop.

提交回复
热议问题