r/learnpython • • 2d ago

How to shut python shell/idle window

hello, I am kinda new to python and I am not sure if someone already answered this in another post but how do you fully shut down the windows running python? Like not just clearing them but getting rid of the whole window

Right so to clarify- Yes I know that the "x" exists im not blind I meant how to close the window without any pop-ups (In the actual code itself)

5 Upvotes

10 comments sorted by

4

u/dparks71 2d ago

quit()

0

u/ActuatorGlittering94 2d ago

in idle that actually prompts a confirmation popup first, so if someone is trying to close it programmatically from a script it wont just shut straight down

1

u/EnvironmentalDot9131 2d ago

yes the python is important 

1

u/NewtLong6399 7h ago
import sys
sys.exit()

1

u/Expensive-Bear-1376 2d ago

Do they not have an "X" button like every window?

0

u/bra1n_gym 2d ago

exit()