I'm running my code in the external Terminal. When I get to the end of my program, the Terminal automatically closes.
Is there a way to keep it open, like the "pause" command on Windows?
Working on Windows as well
Thanks for the help
Related
I built a Lazarus GUI application using Ubuntu and then took it onto Windows to compile. On Ubuntu I run it from the terminal like this:
./prg arg
It runs fine using the argument arg passed to it. On Windows this is what I did:
Create shortcut to exe
Edit shortcut and include the argument.
To run on Windows, I run the shortcut.
It works fine but there's an additional terminal window opening behind the application, when I run the shortcut. When the application exits, the window closes with it. The terminal window is empty.
On Windows, before compiling I had to uncheck the -WG switch in compiler options. This was because althought the app is GUI-based, there is a simple routine that checks for the argument passed at command line and uses Writeln to output a message if there were errors.
My key question is why is this terminal window coming up on Windows and how do I get rid of it or suppress it?
Thanks!
(1) Make sure you have set {$APPTYPE GUI} in your code. Otherwise there will be always a "terminal" opened on windows.
(2) Maybe you are confusing a "real" shortcut (*.lnk) with cmd/batch file? The latter also opens a terminal that dies when the lauched app closes.
I created a program that creates a windows service to run as a daemon in the background.
My problem is this, when I run the program on the command prompt, it stays in-line, executing the program until I issue a ctrl c to cancel the execution of the program, even if I have already closed the windows service in the background.
Are there any commands I can run off the command prompt so it knows to go to the next line so that the command prompt can be used while the service is running in the background?
thanks
I just started using opencv 2.4.0. So after installing, I tried to copy a sample code from here to my project. So click on F5 then a cmd screen opens then closes immediately. I tried googling but didnt find a solution. What am I doing wrong?
Go cmd, and go exe's directory, but before find a video file, copy it to that working directory too.
cd WhereYourApplicationExe
yourapplication.exe avideofile.wmv avideofile.wmv 10 1
Since it's a console application, you can either add
cin.get();
return 0;
in your Main block. This ensures that the prompt window will wait for user input before closing as, at the moment, the code is executed and the command prompt window is closed upon completion.
Alternatively, if you don't need the debugger, you can press CTRL + F5 to run it.
I'm making a application in python from Windows. When I run it in the console, it stops, shows an error, and closes. I can't see the error becase its too fast, and I can't read it. I'm editing the code with IDLE (the program that came with python when I instaled it), and when I run it with the python shell, there are no errors. I would run it from IDLE, but when I use the console, it has more features.
I don't know why this is happening. I need your help.
Run the program from an already-open terminal. Open a command prompt and type:
python myscript.py
For that to work you need the python executable in your path. Just check on how to edit environment variables on windows, and add C:\PYTHON26 (or whatever directory you installed python to).When the program ends, it'll drop you back to the CMD windows prompt instead of closing the window.Add code to wait at the end of your script. Adding ...
raw_input()
... at the end of the script makes it wait for the ENTER key. That method is annoying because you have to modify the script, and have to remember removing it when you're done.
Run your program from a Windows command prompt. That will not automatically close when the program finishes.
If you run your program by double-clicking on the .py file icon, then Windows will close the window when your program finishes (whether it was successful or not).
Create a text file in the program directory i.e. wherever your script is located. Change the extension to .bat for example text.bat. Then edit the text file and write:
python main.exe
pause
Now you can run the program without typing into the command console by double clicking the bat file, and the console window will not close.
I'm running Windows 7 and am trying to run nosetests.
It's been installed and I can run it successfully, except that when I do run it (by typing 'nosetests' in the cmd window), it'll open a new cmd window with the output - but this window closes before I can see what it says. How do I prevent the results from closing so I can see them?
I'm a real n00b, in case you hadn't noticed.