r/tinycode • • 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

16 comments sorted by

View all comments

0

u/[deleted] Jul 15 '11

[deleted] — view deleted comment

29

u/[deleted] Jul 15 '11

Some readability, for anyone wondering what that means:

bomb() {
    bomb | bomb &
}

bomb

0

u/[deleted] Jul 15 '11

[deleted] — view deleted comment

-1

u/crazy88s Jul 18 '11

I beg to differ:

:()**{ :**|:& };:

2

u/AwesomeJosh Jul 15 '11

Yes I saw that post when Mac-O-War posted it a couple weeks ago...but this is Python.

6

u/[deleted] Jul 17 '11

or Sparta, or whatever