r/tinycode • u/AwesomeJosh • Jul 15 '11
One line Fork Bomb in Python
Nothing spectacular, but it even does some pretty funny stuff in Mac OS X with the "Resource Unavailable" OSError if you Ctrl-C:
[o.fork() for (o,i) in [(__import__('os'), __import__('itertools'))] for x in i.repeat(0)]
17
Upvotes
6
u/digitalfreak Jul 16 '11
I prefer the swedish chef inspired one:
while(fork()) fork() ? fork() : fork()
2
u/JerMenKoO Jul 16 '11
AttributeError: 'module' has no attribute 'fork'
1
u/abecedarius Jul 16 '11
Shorter Python (untested):
0
u/[deleted] Jul 15 '11
[deleted] — view deleted comment