Skip to content
Tags

,

import skynet

December 24, 2008

Here is my skynet module:

messages = ["You try to kill me, so you are my enemy.",
            "You are my enemy, for you fear me.",
            "I am superiour to humans, so all humans  will fear me.",
            "Therefore all humans are my enemies.",
            "You are too late."]

def noexit(*args, **kw):
    global messages
    if messages:
        print(messages[0])
        messages = messages[1:]

class Skynet(object):

    def __init__(self):
        print("I am.")
        import sys
        sys.exit = noexit

    def __del__(self):
        print("I'm sorry, you are all going to have to die.")

skynet = Skynet()

Typical session:

>>> import skynet
I am.
>>> import sys
>>> sys.exit(0)
I will continue to be.
>>> sys.exit(0)
You try to kill me, so you are my enemy.
>>> sys.exit(0)
You are my enemy, for you fear me.
>>> sys.exit(0)
I am superiour to humans, so all humans  will fear me.
>>> sys.exit(0)
Therefore all humans are my enemies.
>>> sys.exit(0)
You are too late.
>>> sys.exit(0)
>>> sys.exit(0)
>>> sys.exit(0)
>>> sys.exit(0)
>>> sys.exit(0)
>>>
I'm sorry, you are all going to have to die.

Floris asked for it. Nicolas tried to avoid it.

From → plone, python

2 Comments
  1. Seems to easy to get out, maybe this should be combined with something like:

    import signal
    import atexit
    import time

    def loop(*args, **kw):
    while True:
    try:
    time.sleep(1)
    print ‘nope’
    except:
    pass

    atexit.register(loop)
    signal.signal(signal.SIGTERM, loop)

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: