0

I'm starting coding with python, but and I want to execute my program in a terminal pop-up window in vscode. The problem is that when I open the terminal View > Terminal and type .\helloworld.py it appears a pop-up window but when the code ends, it closes immediatly. I just want that the windows stays opened

The code ends because it's just a print("Hello World")

I'm looking if there's a configuration in the terminal like a .json that do not close the windows even though the program has end if it is posible (I know I can make an input("")).

Agente 156
  • 78
  • 6
  • Does this answer your question? [How can I stop python.exe from closing immediately after I get an output?](https://stackoverflow.com/questions/3591807/how-can-i-stop-python-exe-from-closing-immediately-after-i-get-an-output) – Krerkkiat Chusap Aug 04 '21 at 11:21

1 Answers1

0

If just print("Hello World") in your code, you may try adding "console":"externalTerminal" in launch.json, then Run> Run without Debugging to get code executed in the external Terminal:

enter image description here

Molly Wang-MSFT
  • 7,943
  • 2
  • 9
  • 22