Digits of PI (Part 1)
I like simple solutions. So instead of generating the digits, I simply fetched the data from the web. This is a fast, efficient, and painless approach of the problem :) Visit http://newton.ex.ac.uk/research/qsystems/collabs/pi/, where you can download several data files.
For the lazy pigs
I made a script that downloads the data, parses them, and returns the digits as a string. Here it is.
Usage (get the first 30 digits of PI after the dot):
#!/usr/bin/env python from jabbapylib.math import pi def main(): digits = pi.get_digits_of(pi.PI3) # get 10^3 = 1000 digits print digits[:30] if __name__ == "__main__": main()
jabbapylib is here