Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Close IDLE display window?
#1
(Forgive improper terminology if any) When I run a .py program in IDLE, it opens a display window to see the output of the program. The problem is what when the program is done I would like it to close the display window?

I know I cannot clear the screen but can I use software to close it?
Reply
#2
Quote:it opens a display window to see the output
Does this window have >>> on it, or is it a small black window?
Recommended Tutorials:
Reply
#3
If you want it to always close, you should probably just use the command line program rather than IDLE.
Reply
#4
(Jan-02-2018, 07:55 PM)metulburr Wrote:
Quote:it opens a display window to see the output
Does this window have >>> on it, or is it a small black window?

It is not the black command line window which closes naturally at the end of the program as it should.

However, the IDLE window that shows the output of the program does end with >>> and that is the window I want to close automatically when the program is finished executing.
Reply
#5
This is a feature of IDLE. Most IDE's will have some output display section, in some form or fashion. IF you want to run a program and not see it, then run it in your terminal/command prompt instead of using IDLE.

More info here
https://python-forum.io/Thread-Basic-How...ython-code
Recommended Tutorials:
Reply
#6
It is the IDLE window with the >>> at the bottom that I want to use but would prefer it to close when the program is done. My last line of code is EOP=Input("Do you want this program to close") which will hold the results on the screen until I hit any key. Then I want it to close instead of staying open with the >>> at the bottom.
Reply
#7
Use the command prompt to execute python then, not IDLE.
Recommended Tutorials:
Reply
#8
How many more ways can I say it?

I am fully aware that the command line window will close when the program is done. I choose not to use it for various reasons. The question remains: Is there code to close the IDLE window that finishes with >>> at the bottom?
Reply
#9
Quote:I am fully aware that the command line window will close when the program is done. I choose not to use it for various reasons.
Then you will not be able to close it.

The closest thing you can come to is make a system call to kill IDLE after your program is complete, but that is just ridiculous. You might as well run it from the command prompt in the first place.
Recommended Tutorials:
Reply
#10
Ok, to close the thought. You are saying that it is not possible to use code to close the display window that contains >>> at the bottom. I was afraid of that. I do know that there is also no such thing as CLS to clear it either.

On to bigger and better code.....
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a way to call and focus any popup window outside of the main window app? Valjean 6 1,789 Oct-02-2023, 04:11 PM
Last Post: deanhystad
  What is all the info in the info window in Idle? Pedroski55 3 704 Jul-08-2023, 11:26 AM
Last Post: DeaD_EyE
  How to display <IPython.core.display.HTML object>? pythopen 3 45,981 May-06-2023, 08:14 AM
Last Post: pramod08728
  Pyspark Window: perform sum over a window with specific conditions Shena76 0 1,180 Jun-13-2022, 08:59 AM
Last Post: Shena76
  How can I display dictionary in a gui window in Python? C0D3R 2 1,742 Apr-07-2022, 07:33 PM
Last Post: C0D3R
  Closing Threads and the chrome window it spawned from Tkinter close button law 0 1,711 Jan-08-2022, 12:13 PM
Last Post: law
  How to automatically close mathplotlib output window? Pedroski55 2 1,940 Jun-17-2021, 09:00 AM
Last Post: Pedroski55
  IDLE editing window no longer works chris1 2 2,220 Feb-06-2021, 07:59 AM
Last Post: chris1
Information Unable to display joystick's value from Python onto display box MelfoyGray 2 2,238 Nov-11-2020, 02:23 AM
Last Post: MelfoyGray
  IDLE not importing pygame (ok outside of IDLE) miner_tom 1 3,331 Sep-14-2018, 07:54 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020