Questions tagged [exit]
Exiting, quitting, or halting refers to the termination of a process or program.
2,676
questions
0
votes
0
answers
21
views
quit and exit do not work inside while loop
Using Spyder on windows10.
This keeps running infinitely when one might expect the code to exit if i>3:
import time
i = 0
while True:
i+= 1
print('hello')
time.sleep(1)
if i > ...
2
votes
2
answers
39
views
Unexpected exit code (2 and 3) of c programs
I'm having this weird problem which I can't really figure our why this is happening.
Note: these programs are executed on centOS at the bash command line.
I have two similar C programs which are:
...
0
votes
1
answer
21
views
Why is "q enter" not allowing me to exit from my terminal? [closed]
I pressed q enter, but it just returns
"bash: q: command not found"
What the problem and how can I fix it?
0
votes
0
answers
8
views
Exit a java program deployed on heroku
I have a worker running on Heroku which exits itself when there is no work. However, exiting my program from within the program is considered a crash by Heroku.
How can I quiet the java program so it ...
0
votes
0
answers
43
views
+50
When debugging script: Process finished with exit code -1073741819 (0xC0000005) but not when running script
I am getting this error when using the debugger, and I am not having it when running my code. I am trying to understand this answer which seems to raise the same thing but that barely gives any advice ...
0
votes
1
answer
19
views
what does shutdown -p command do?
In Linux, what does shutdown -p command do, will it directly power off the system without Halting? if it halts the system first then power off, then can we directly power off without halting using any ...
0
votes
0
answers
21
views
Process finished with exit code -1073740771 (0xC000041D)
I'm trying to figure out what this message means
Process finished with exit code -1073740771 (0xC000041D)
I'm making an application using wxpython. The whole thing is a chat so there are a few ...
0
votes
2
answers
35
views
While != "specific string" loop mishap
I'm trying to make a task a little more efficient. I'm going to continue to research/edit while moving forward.
What the code currently does is ask for your first/last name it then outputs a username &...
1
vote
1
answer
42
views
Python, __exit__ method should it use return False or no return at all
What's the preferred way and why for __exit__ method when it comes to returning value?
Should I write return False or no return at all since that will return None, I think behaviour in both cases will ...
0
votes
0
answers
32
views
How do You exit from an application without exiting the menu that activated the application?
Bear with me... Im not sure how to ask this question.
I'm working on a Web site using VB.NET and Visual Studios 2017 (soon to upgrade to VS 2019). The software is activated by a website menu item ...
-1
votes
0
answers
23
views
How can I Implement Exit confirmation with Xamarin.Android?
I need a exit confirmation dialogue once the user pressed back button. I cannot find any resources online because most of the information are about Xamarin.Forms. What I need is for Xamarin.Android, ...
1
vote
1
answer
25
views
PHP caching script without breaking page
I'm using a simple PHP-cache script which looks like that:
<?php
$url = $_SERVER["SCRIPT_NAME"];
$actual_link = $_SERVER['REQUEST_URI'];
$id = basename($actual_link);
$cachefile = '...
0
votes
0
answers
11
views
My program is skipping if statement (if user chooses _) which exits the program, but only if something else was chosen prior to that
**I am aware the code is very odd... my assignment has strict requirements that we have to use try-catch's for almost everything, even if not necessary
My program is a booking system. This is the code:...
0
votes
0
answers
11
views
Python code continues running even after finishing on Ubuntu
I am running Python 3.9.12 on Ubuntu 16.04 using an Anaconda environment. I've found that all my scripts don't finish whenever they reach the end of execution, as in, they do not exit with code 0.
...
1
vote
0
answers
31
views
Unable to exit docker container from a bash script [duplicate]
Main script
copy a shell script to Docker a container
docker exec -it containerid /bin/bash to login to the container
exec sub shell script
Sub shell
executing docker commands.
The sub shell ...
-2
votes
1
answer
52
views
change the exit status of a C/C++ program during atexit callback
I'm looking for a way to change the exit status of a C/C++ program during an atexit callback sequence.
I'm develping some C++ code that registers a book keeping function with atexit. If the program ...
0
votes
0
answers
15
views
BASH script file - run command with alias in interactive mode -> prevent logout/exit [duplicate]
I am trying to run Variable as command with aliases sourced from file
Bash script file:
source /...path_to_file.../file.txt
#. /...path_to_file.../file.txt
CMD="$...variable1..."' '"$.....
-1
votes
1
answer
58
views
How do I exit python program with control d?
I have a python program that uses a while loop to check for a user input. I want it to keep running while a user enters an input, but quit when the user enters ctrl d. Currently, I get EOFError when ...
0
votes
1
answer
44
views
What is the difference between return 1 and exit (1) from a C main function? [duplicate]
In a C program, within the main function, is there a difference between
exit(1);
and
return 1;
?
0
votes
1
answer
56
views
Should I use exit(1) or abort() for invalid inputs in C library functions?
I am coding a small C function for a math library. This C function takes a positive integer as input and reports errors if the input is nonpositive. I am considering two different kinds of ways to ...
0
votes
1
answer
73
views
NameError: name 'quit' is not defined [closed]
I was trying to make a simple project (tic tac toe) to use the things I learned in Python and Tkinter, but when I was making a quit button, it worked when I ran the Python file, but when I converted ...
0
votes
0
answers
24
views
python manually finish writing file
I have a program which receive a file.BIN from socket TCP/IP but I don't know how to exit the writing loop
Here is a piece of my code:
with open(f"recv_{FILENAME}", "wb") as f:
...
0
votes
1
answer
46
views
Bash script not exiting with "exit" without subshells (I think)
I'm using stow to manage my dotfiles and I'm writing a script that can set up my pc and packages automatically. I have all my config files in a config folder and that's the stow folder. What I'm ...
0
votes
1
answer
51
views
How do I loop the python program infinite times til I type q to quit and have the total cost of input on the next column?
I could not get the code to loop infinite times to increase my csv file and add all the input to create a total cost in next column after price input.
So far I got this setup:
import sys
import csv
...
0
votes
1
answer
28
views
Ctrl-C for exit the program isn't working without enter
I was using Runtime -> addShutDownHook for closing application.
It works with an enter, but only typing ctrl+c doesn't do it's job. Is it because I opened scanner at the beginning of the class? ...
0
votes
2
answers
44
views
Cannot stop BASH when using of && and || operators
I would like to stop my BASH if the commands have any errors.
make clean || ( echo "ERROR!!" && echo "ERROR!!" >> log_file && exit 1 )
But seems like my BASH ...
0
votes
1
answer
44
views
How to close an executable on Python like clicking on exit button
I will explain my problem :
For an application for my system I would like to know how to close an executable, like clicking on the pushbutton exit in the top rigth, as usual. Context :
From a script ...
1
vote
2
answers
95
views
C, How to use exit code properly?
When I try to submit my work, the system told me to use the exit code. When I use return 0 and recheck, the system told me to use return 1...
(https://i.stack.imgur.com/dnVLV.png)
:) caesar.c exists. ...
0
votes
1
answer
31
views
How to close an executable window Python
I will explain my problem :
For an application for my system I would like to know how to close an executable, like clicking on the pushbutton exit in the top rigth, as usual.
Context :
From a script ...
0
votes
1
answer
24
views
Python - Converting roman numerals to integers in a loop, ending script with specific character
Very new to Python, i've managed to do some research on Stack Overflow and using the code below, successfully converted roman numerals to integers.
def romanToInt(s):
d = {'m': 1000, 'd': 500, 'c':...
0
votes
1
answer
41
views
Problem with Recursive Exception to Send Continuous Email Notification in Python
I'm trying to make an exception that will call itself if it catch an exception. The goal is to send notification email without interruption due to errors from the server. But I got stuck with stack ...
0
votes
0
answers
37
views
Exit from Jquery $.each loop which has function call and if statements inside it
I want to exit out of the jquery $.each loop when when the exit variable in my function is 1.
Below is the API response :
{
"data": [{
"name": "rotate",
...
0
votes
1
answer
41
views
Tkinter bind Mac OS "command+q"
I'm trying to "stop" the root window exiting when I press "Command+q" but it's impossible.
The other key shortcuts work on my Mac OS, even in Windows/Linux, "Alt+F4" bind ...
1
vote
1
answer
62
views
how to check if the Expect->spawn($command) is success?
I am passing an scp command in Expect->spawn($command), I am also passing the password or password + OTP based on a $object->expect().
Could you let me know if there is a way to determine if the ...
0
votes
1
answer
95
views
C++ What exactly does exit() do when using multiple threads?
I'm working on some code that uses an existing code-base which is now a DLL. What I'm trying to do it to terminate all the threads that are were started, but keep my main program running.
This is the ...
2
votes
1
answer
68
views
How do I set a function to run on exit in fish shell?
I want to do some cleanup before my shell script exits, including when it's cancelled with Ctrl-C.
I tried this code (in a script.fish file):
function exit_handler --on-event fish_exit
echo ...
0
votes
0
answers
26
views
Script using multiprocess with queue does not exit after done
I made a script using multiprocess with queue.
When the script done, it still remains not exit.
I checked similar cases in stackoverflow and tried solutions, but failed.
Would you kindly review my ...
0
votes
1
answer
134
views
Ionic 5 Harware Back Button only refresh the home page (without exiting the app)
I am a bit new to mobile developments and in my app (Ionic 5, Angular 13, Android 9) I want to exit the app on touch of hardware back button (Best is at the home page). However, it only refresh the ...
0
votes
2
answers
57
views
Python Dict 2 argument, how to exit the while loop with one <enter>
Have written below program, but how to avoid the system checking the two argument when enter is pressed, we are using the enter key to exit the while loop.
while True: # need to exit the while loop ...
0
votes
2
answers
35
views
Why does code break on exit when adding a conditional for calling the #define function
My problem is I am trying to add a conditional if-else statement.
The whole program works fine with the original code, but the code breaks when I add it.
My first question is why is it breaking?
My ...
0
votes
1
answer
43
views
How to terminate a terminal session in a ps1 script
How can I terminate a terminal/PowerShell window from a .ps1 script? I would like it to work the way exit in command line works, but when I put that in a PowerShell script it only terminates the ...
1
vote
1
answer
234
views
How to make a docker container exit with a specific error-code with docker-compose?
I can spin up a Docker container with docker-compose and check its exit code with this example:
# Dockerfile
FROM alpine:3.15 as base
# docker-compose.yml
version: '3.6'
services:
dummy:
build:
...
0
votes
1
answer
89
views
Docker run mysql-server not initializing
I am trying to initialize mysql container within Docker by the following command:
docker run --name some-name -e MYSQL_ROOT_PASSWORD=my-password -e MYSQL_DATABASE=db-name mysql/mysql-server
It pulls ...
1
vote
0
answers
58
views
c++ using constructor together with _exit() function
I have a question about the _exit() function regarding destructors.
I found that calling _exit() does not call destructors.
In this example of "main.cpp", the destructor of someThing is ...
0
votes
1
answer
26
views
Why d we need child exit after execvp?
I have been recently wondering why do we need to use exit after the execution of a child after performing execvp. An in depth explannation is welcome.
0
votes
1
answer
27
views
VSCode Python SSH - Debug aborted without errors or warnings
I am developing an application on a remote server.
I'm using Python and am connected via ssh with the specific extension.
I start debugging and everything seems to proceed normally but suddenly ...
0
votes
0
answers
71
views
How to let the main thread end after the child thread ends itself in C++? (Windows)
There is a main thread whose execution content CANNOT be controlled due to special irresistible reasons, that is, it has no ability to process any messages sent by child threads including events.
This ...
0
votes
3
answers
65
views
How to exit this while loop when the user presses enter
hi I am new to programming I just want to know how can I exit this program using just the enter? Can't use the if not due to the split.
while True:
try:
Student.id, Student.name, Student....
0
votes
0
answers
125
views
sys.exit() with custom message returns error when run in IPython console in PyCharm
I have the following (very simple) Python script that I'm trying to run in PyCharm:
import sys
sys.exit('My custom message')
In the "Run/Debug Configurations" window of PyCharm, if "...
0
votes
1
answer
38
views
Application exit with code -8 before even tries to divide by 0?
I have code like this:
#include <stdio.h>
#include <stdint.h>
int main() {
uint8_t result = 0;
uint8_t a = 0;
printf("Trying to divide by %d...\n", a);
result = (...