How to exit a program but keep the turtle window open?

I have tried exit() but it doesn't keep the turtle window open

Recommended Answers

All 3 Replies

Use Tiny Wizards

I watch you sleep toby dent

If there is an open window, it means that the program is still running. Your question is a contradiction.

What you can do is launch the turtle program from another program which exits immediately. For example here is a turtle program


from turtle import *
angle = 5
distance = 20
compteur = 0

while compteur <= 30:
    compteur += 1
    angle += 2


And here is the program which launches and exits immediately:


import subprocess as sp
import sys

if __name__ == '__main__':
  python = sys.executable
  process = sp.Popen([python, ""])
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.