Deprecated: Assigning the return value of new by reference is deprecated in /f2/blendedtechnologies/public/wp-content/plugins/pmetrics.php on line 1192
Blended Technologies » Blog Archive » Python Madness - Crash your computer in just 3 lines of code

Python Madness - Crash your computer in just 3 lines of code

So a coworker mentioned he wanted a file that would launch multiple programs for him. Being helpful like I am, I whipped up a quick Python script:

import os
os.startfile(”C:\Program Files\IrfanView\i_view32.exe”)
os.startfile(”C:\Program Files\Google\Google Talk\googletalk.exe”)
#…etc

I sent it off to him and he was happy. But being curious as I am, I decided to make the script call itself and see what would happen…

File: startfiles.py

import os
os.startfile(”startfiles.py”)
os.startfile(”startfiles.py”)

Warning, save all your work on your computer before you try running this!

And here are my results: (can you beat my 258 processes?)

Python Maddness

del.icio.us |  Digg |  FURL |  Yahoo! My Web 2.0 |  Reddit

5 Responses to “Python Madness - Crash your computer in just 3 lines of code”

  1. Tom Says:

    You can do this in c too by recursively calling fork() :)

  2. Brian Says:

    This is the equivalent of the old unix classic fork bomb:
    #!/bin/sh
    $0 & $0

  3. Uchi Says:

    Hmm, to bad this didn’t crash my computer. I guess I have to much memory. ;)

  4. Greg - CEO/Founder Says:

    Uchi, what happened? Did your computer at least slow down to the point where you couldn’t use it?

  5. Computer Maintenance Tips Says:

    Computer Maintenance Tips…

    I couldn’t understand some parts of this article, but it sounds interesting…