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.
March 15th, 2007 at 12:23 pm
Liar
>>> import pi
Traceback (most recent call last):
File “”, line 1, in ?
ImportError: No module named pi
March 15th, 2007 at 12:23 pm
Heh, oops, I read this in bloglines which had messed up the formatting
March 15th, 2007 at 5:31 pm
Heh.
You could also do `import math` and then call it as math.pi. :P