Thread: Editing Time

    #1
  1. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    155

    Editing Time


    I'm trying to do the following:
    When a user sends this command, the are to select a number, the number stands for the amount of minutes, it can go up to only 60, and a message will get sent that many minutes later. For instance, if they chose number 25, the message (I have a random quote that gets sent as a message) gets sent 25 minutes after the current time. Is there an easy way to doing this? Or do I have to edit the time for every possible minute the user can choose and then compare that time with the current time?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    London, England
    Posts
    1,585
    Rep Power
    1373
    Code:
    import time
    
    delayInMinutes = int(raw_input("how many minutes?"))
    time.sleep(60 * delayInMinutes)
    print "some random quote"
    Dave - The Developers' Coach

    Comments on this post

    • CyBerHigh agrees

IMN logo majestic logo threadwatch logo seochat tools logo