Questions About Enteredgiveaway

Stay active while sleeping in Python

if ":!giveaway" in prevdata and senderusr in securelist and agive == 0:
    agive = agive+1
    message("Giveaway started by: " + senderusr)
    time.sleep(3)
    agive = 0
    enteredgiveaway = enteredgiveaway.rstrip()
    enteredgiveaway = enteredgiveaway.split(" ")
    gg = random.choice(enteredgiveaway)
    message("The winner of the giveaway is: " + gg)
    gg = ""
    enteredgiveaway = ""

if "PRIVMSG" in prevdata and agive == 1:
    enteredgiveaway += senderusr + " "

The first if starts a giveaway and then after 3 seconds will select a random user that typed in the IRC and message the IRC saying whoever won.

However, my problem is that the second if is unable to collect users because the first command sleeps the program and the other if is unable to work.

How do I sleep but have the program be able to do to other stuff ?

(IRC Bot)

Entire Code : http://www.stackoverflow.com/questions/12755515/stay-active-while-sleeping-in-python