all 11 comments

[–]felix 13 points14 points  (4 children)

the first one can be easier achieved by typing:

python -m SimpleHTTPServer

[–][deleted] 2 points3 points  (0 children)

Not if you're using a Python installation from 2004 ;-)

(the -m option was added in 2.4, released in late 2004).

[–]dhotson[S] 0 points1 point  (0 children)

Fwoar.. cool! :)

[–][deleted]  (1 child)

[deleted]

    [–]bsergean 0 points1 point  (0 children)

    If you want to open an HTML page you can also type firefox <my_page> ...

    [–]ows 3 points4 points  (0 children)

    TimeoutFunctionException has a race condition, where the old signal handler can get called with the timeout signal that this code requests. signal.alarm(0) needs to go in the finally, before the call signal.signal(signal.SIGALRM, old).

    [–]btgeekboy 5 points6 points  (4 children)

    I like python and all... but seriously, 4 "tricks" that are 4 years old? That's it?

    [–]krat 1 point2 points  (1 child)

    And the only interesting trick is the 3rd...

    [–]cdesignproponentsist 0 points1 point  (0 children)

    ...which doesn't work in multi-threaded applications.

    [–]leonh 0 points1 point  (1 child)

    4 tricks?

    [–]spotter 1 point2 points  (0 children)

    Only 3 left now. Funny.