Compute pi to base 12 using Python?

Dick Moores rdm at rcblue.com
Sun Apr 17 07:40:54 EDT 2005


Paul Rubin wrote at 02:35 4/17/2005:
>Dick Moores <rdm at rcblue.com> writes:
> > >C:\cygwin\bin\bc -l > pi12.txt
> >
> > But how or when do you enter the lines
> >
> > scale = 3000
> > obase = 12
> > print 4 * a(1)
>
>You could put them into a file, say pi.bc.  Then run
>   bc -l pi.bc

OK, now that I've got Textpad trained to open .bc files, I'm thinking of 
things to store in them. I'm sure I'll want to put in some remarks as 
well. What should I use to mark the remarks. "#", "//", or what?

The bc man page at <http://www.rt.com/man/bc.1.html> is tough. Any 
suggestion for more easily understandable help?

And finally (maybe), is it possible to employ bc within a Python script?

Thanks,

Dick






More information about the Python-list mailing list