Login

import skynet

2008-12-24 10:31

So here is my modest skynet module proposition to avoid an xkcd's like disaster:

import sys; print 'Not a good idea'; sys.exit(0)

And here it is in action:

kinder:~ % python                                                        #10005
Python 2.5.2 (r252:60911, Nov 14 2008, 21:49:10)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import skynet
Not a good idea
kinder:~ %

A merry whatever-mas to all of you !

Comments

1. 2008-12-24 17:07 : by James Thiele

Modified to work in 2.x and 3.x:

import sys; print ('Not a good idea'); sys.exit(0)

2. 2008-12-24 19:50 : by Andrew Dalke

I wouldn't trust that. sys.exit only raises an exception, which is catchable. Even if uncaught, the normal exit calls registered atexit hooks. To prevent Skynet, or raptors with lightsabers, I would use os._exit(0) instead.


Post a comment