Pause a script before termination

Discussion in 'Python' started by noydb, Nov 11, 2009.

  1. noydb

    noydb Guest

    Hi All,

    I want to pause my script before it terminates, just so a user can
    have a moment to read some print statements I include at the end. How
    can this be accomplished?

    Thanks!
     
    noydb, Nov 11, 2009
    #1
    1. Advertising

  2. noydb

    noydb Guest

    On Nov 11, 11:43 am, noydb <> wrote:
    > Hi All,
    >
    > I want to pause my script before it terminates, just so a user can
    > have a moment to read some print statements I include at the end.  How
    > can this be accomplished?
    >
    > Thanks!


    Never mind, duh, found my answer now

    import time
    time.sleep(10) #10 second pause
     
    noydb, Nov 11, 2009
    #2
    1. Advertising

  3. On Nov 11, 2009, at 11:47 AM, noydb wrote:

    > On Nov 11, 11:43 am, noydb <> wrote:
    >> Hi All,
    >>
    >> I want to pause my script before it terminates, just so a user can
    >> have a moment to read some print statements I include at the end.
    >> How
    >> can this be accomplished?
    >>
    >> Thanks!

    >
    > Never mind, duh, found my answer now
    >
    > import time
    > time.sleep(10) #10 second pause


    Good for you for tracking that down.

    However, might I suggest that you replace that with a message like
    "Press <Enter> to clear this message and end the program"?
     
    Philip Semanchuk, Nov 11, 2009
    #3
  4. noydb

    Gary Herron Guest

    noydb wrote:
    > Hi All,
    >
    > I want to pause my script before it terminates, just so a user can
    > have a moment to read some print statements I include at the end. How
    > can this be accomplished?
    >
    > Thanks!
    >

    If your IO is to/from a command line window, try this:

    raw_input('Hit ENTER to exit: ')

    Gary Herron
     
    Gary Herron, Nov 11, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Shohet
    Replies:
    10
    Views:
    1,944
    Kevin Spencer
    Jun 18, 2004
  2. GrantMagic

    pause a loop

    GrantMagic, Jul 28, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,993
  3. titanandrews
    Replies:
    7
    Views:
    1,025
    Jerry Coffin
    May 11, 2008
  4. shawn bright

    how to pause a script

    shawn bright, Apr 9, 2007, in forum: Ruby
    Replies:
    2
    Views:
    105
    shawn bright
    Apr 9, 2007
  5. Replies:
    0
    Views:
    82
Loading...

Share This Page