Script created in Pycharm closes by pressing the "enter" key inside the terminal

Asked

Viewed 53 times

0

Here’s the thing. I’m new in the middle of programming. I use Pycharm to study python. When I try to run a script created in Pycharm by IDLE, just after I hit the "enter" key the window closes. Scripts created in IDLE normally run until the end. For example. I give two clicks on the script I created in Pycharm, will open that terminal window, the first line of code is an input let’s assume. Soon after I write something and press "enter", the window closes. But if I take the same code, save the script by IDLE, the program works normally. Why does this happen? Is it a bug of Pycharm’s own? I’m a little layy yet, if anyone can help me I appreciate.

1 answer

1

without seeing your code it gets a little difficult to help you, but I believe that what is happening is something normal:

  • the program executes the code
  • to receive an information
  • performs all the next steps and finishes as fast (as obviously has to be) as you don’t see what is happening.

You can visualize by Pycharm because it was made for you to develop any program, whereas the terminal is not exactly an ideal graphical interface for you to use.

If you want to write a program that has user interaction, there are frameworks for this like Pyqt, Tkinter, wxPython, Pyside... and several others.

I hope this gives you a north, otherwise edit your question and let us better understand what’s going through your head

Browser other questions tagged

You are not signed in. Login or sign up in order to post.