#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    5
    Rep Power
    0

    Python3 Turtle project (quick help)


    Hi guys, I just signed up for this site

    I'm very new to programming and need a bit of help with my first project.

    The question is how do I "End your program with the input() command, so the turtle window stays around until you press return."

    I had something like this

    s = input()
    if s == <return>
    turtle.end()
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,995
    Rep Power
    481
    You're probably using Microsoft windows. You probably activated your program by "clicking an icon". Or maybe the program name wherever you happened to find it.

    The Microsoft console "DOS box" is usually set up to close when the program completes. Or maybe this isn't the issue. Whatever.


    Anyhow, your program should probably end with (assuming python 3)
    Code:
    input('press enter to finish')
    turtle.end()
    Python won't recognize
    <enter>
    It does recognize the often useful string '\n' .

    Comments on this post

    • Brunch agrees : Thank you sir, worked great
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    5
    Rep Power
    0
    Thank you for your help...worked perfectly

IMN logo majestic logo threadwatch logo seochat tools logo