Happy Pi Day!

Today is 3/14… Pi Day! And in honor of this great day, James Tauber wrote a Python script to generate the hex digits of pi. Nice!

If you are so inclined, Wikipedia has a nice article on the various methods of computing pi. Here’s my favorite method:

#!/usr/bin/env python from math import pi print pi
Heh.

3 Responses to “Happy Pi Day!”

  1. Nathan Powell Says:

    Liar

    >>> import pi
    Traceback (most recent call last):
    File “”, line 1, in ?
    ImportError: No module named pi

  2. Nathan Powell Says:

    Heh, oops, I read this in bloglines which had messed up the formatting

  3. John Says:

    Heh.

    You could also do `import math` and then call it as math.pi. :P

Leave a Reply