When you process in main function it never ending. When you are calling a function in main function and processing to the end, you will sometime get stuck at some particular line of code. How to end processing in main function with terminal statement? The following will show you how to run a Python program and end processing until a specific line of Python code is executed (or until it ends or crashes). If you want to run your Python program interactively in the IDLE GUI window, then this post will be helpful.
Having a frozen or unresponsive windows program is such a bother especially when you haven’t saved your progress. If the situation makes your system fan run so fast and consume more resources, it is better to sacrifice that program by ending it forcefully. Here are some common methods on how to end processes that are difficult to close.
How To End Unresponsive Process?
Method 1: Using Task Manager
- Open Task Manager through either of the following methods:
a. Right-click on the Taskbar and select ‘Task Manager’.
b. Press ‘Ctrl’, ‘Alt’ and ‘Delete’ on the keyboard and select ‘Task Manager’. - Click on ‘More details’ to display more settings of Task Manager.
- Here, you will see many technical terms. To understand the next step, we need to familiarize the terms presented. The most needed tab to end an unresponsive program is the ‘Process’. Under the tab, the programs are grouped either in ‘Apps’, ‘Background processes’, or ‘Window processes’. The number beside the category indicates how many of those are currently being open in Windows.
- To expand the details of a process, under a category, that is currently running, click on the arrow-right icon located at the left side of that item.
- You can pinpoint the unresponsive program through its name. Sometimes, that program is difficult to close because other programs are consuming the computer resources unnecessarily. You can end them first before ending the selected program. To further understand the columns with percentages, here are the breakdowns:
a. CPU = the resource that is being consumed while a program is running
b. Memory = the resource used while a program is active
c. Disk = displays processes that transfer files
d. Network = displays processes that download or upload files - The usual problem will be those that have high CPU usage. Typically, a normal program doesn’t have a CPU usage above 30 percent. If there is a program that has a percentage greater than that for some time, it will be better to end it. To do so, right-click on the program and choose ‘End task’. You can also achieve the same result by selecting the program and clicking the button ‘End task’ found in the lower-right corner.
- Make sure that you are familiar with the program that you wanted to end. If not, you can try searching for the nature of the program online. Ending a task of something important might cause a crash on Windows.
- After ending a program that consumes a high amount of computer resources, granted that you knew what you did, you can end the program you needed to end initially. After ending the programs, you can close the Task Manager window.
Method 2: Using Taskkill Command
- On your Desktop screen, right-click on an open space.
- Select ‘New’ from the menu, and then, select ‘Shortcut’.
- When asked to enter the location of the shortcut, enter the following command: taskkill /f /fi “status eq not responding”.
- Click the ‘Next’ button to continue and then click on ‘Finish’. This means that whenever there is an unresponsive program that you wanted to end, you can just double-click on the created shortcut found on the Desktop screen.
- Another alternative is to use the Command Prompt. On the Windows search bar, type in ‘CMD’, and from the results, select ‘Command Prompt’ or ‘CMD’ by right-clicking on it and choose ‘Run as administrator’.
- In the window, type in tasklist to display all running tasks.
- As an example, we will use the Notepad app as the program subject to be closed. Type then taskkill /f /IMnotepad.exe wherein ‘F’ means that the task will end ‘forcefully’ and ‘IM’ stands for image name. In case you are not aware of the file extension of the program, just type in taskkill/? first before ending a certain program.
Method 3: Using ‘ALT + F4’
- Tap the unresponsive program you want to end forcefully.
- On your keyboard, press the keys ‘Alt’ and ‘F4’ at the same time. If nothing happens, try for a few occasions before resorting to other methods.
Summary: End processing not ending easily
- To stop a running process, you can close the terminal window.
- First, identify the process.
- Then, use the Process ID to kill the process.
Conclusion
To further avoid such a situation, you can upgrade your computer with higher specifications. By doing so, the program will have less tendency to get frozen and other programs will not get affected.