

In Windows, it is called Command Prompt.How you go about opening a terminal window varies depending on which operating system you’re using: In a GUI desktop environment, it is likely that the installation process placed an icon on the desktop or an item in the desktop menu system that starts Python.įor example, in Windows, there will likely be a program group in the Start menu labeled Python 3.x, and under it a menu item labeled Python 3.x (32-bit), or something similar depending on the particular installation you chose.Ĭlicking on that item will start the Python interpreter: The Python interpreter (REPL) running inside a terminal window.Īlternatively, you can open a terminal window and run the interpreter from the command line. Most of the example code in this tutorial series is presented as REPL interaction. The session continues in this manner until you instruct the interpreter to terminate. Prints the output (if any) to the console.That simply means starting up the interpreter and typing commands to it directly. The most straightforward way to start talking to Python is in an interactive Read-Eval-Print Loop (REPL) environment. Open a command prompt and type: For that to work you need the python executable in your path.Remove ads Using the Python Interpreter Interactively How can I keep it open? You have a few options: Run the program from an already-open terminal. I need it to stay there so I can analyze my output. When I execute a python script file on Windows, the output window appears but instantaneously goes away. Click the Windows logo in the bottom-left corner of the screen. How to use Windows command prompt to run Python file? Beware that if your program contains syntactical errors, the window will still close if you ran it via double-click and put cmd /k at the end.

How to keep CMD open after BAT file executes?ĭepending on how you are running the command, you can put /k after cmd to keep the window open. Open a command prompt and type: For that to work you need the python executable in your path.

You can easily see each command which had run on the result of bat file in CMD… This will keep the Command Prompt window open until you do not press any key. Now add “PAUSE” word at the end of your bat file. How to keep command prompt open after running commands?Įdit your bat file by right clicking on it and select “Edit” from the list.
