where to buy misoprostol online how to buy valtrex
Send a message THROUGH TIME in Python (joke) | Evan Fosmark

Send a message THROUGH TIME in Python (joke)

Who says time travel isn’t possible?

import time
 
def send_to_future(message, seconds):
    time.sleep(seconds)
    return message

I’ll leave it up to someone else to write the send_to_past() function. ;-)

 

 

4 Comments

  1. ferringb wrote,

    Should’ve used deferreds… they fit the joke better ;)

  2. Juho Vepsäläinen wrote,

    Perhaps something along

    import time
     
    def send_to_past(message, seconds):
        print message
        time.sleep(seconds):
        print 'Sent message to the past."

    would do the trick. (Based on the idea that this moment is the past of the future.)

  3. Marius Gedminas wrote,

    Easy: just pass a negative number for seconds.

  4. farmerjoe wrote,

    For your send to past function, I suggest resetting the system clock to an earlier time.
    Something on the order of

    import time, os
    def send_to_past(message, seconds):
     
        t1 = time.time()
        os.system( 'date %s' % asctime(t1-seconds)) 
        return message

    You can verify it works by:

    print 'sending message at time', time.asctime()
    m2 = send_to_past("Posting this message")
    print 'received message at time', time.asctime()
    print m2

Leave a comment

Buy Topamax
Purchase Dapsone Meds
Buying Cymbalta Low Cost
Low Price Diflucan In Internet No Prescription
Online pharmacy trusted
Next Day Dapsone Delivery
Dilantin Without Prescription Cod
Buying Dapsone in New Zealand
Can I Purchase Cytoxan Online Fast Delivery
Crestor pharmacy cost
Purchase Dapsone Online No Prescription
When To Take Dilantin
Cheap Diflucan No Prescription
Buy Generic Dilantin in US
Order Tetracycline Irelan
Purchase Inderal Cod Cash Delivery
How To Buy Dapsone Online Without A Perscription
Buy Dilantin Cheapest
cheapest buy Diflucan online
Purchase Cytoxan COD