Is this what you are looking for? >>> from sympy.ntheory.factor_ import digits >>> digits(1234,20) [20, 3, 1, 14] >>> help(digits) Help on function digits in module sympy.ntheory.factor_:
digits(n, b=10) Return a list of the digits of n in base b. The first element in the list is b (or -b if n is negative). Examples ======== >>> from sympy.ntheory.factor_ import digits >>> digits(35) [10, 3, 5] >>> digits(27, 2) [2, 1, 1, 0, 1, 1] >>> digits(65536, 256) [256, 1, 0, 0] >>> digits(-3958, 27) [-27, 5, 11, 16] On Tuesday, July 7, 2015 at 3:00:20 PM UTC-5, Robert Pollak wrote: > > Am 2015-07-06 um 20:23 schrieb Aaron Meurer: > > I think mpmath has some support, although it may be low-level. Look at > > https://github.com/fredrik-johansson/mpmath/blob/master/demo/pidigits.py, > > > which uses mpmath to compute the digits of pi in any base. > > Thank you - that looks promising. > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/1adaa79b-f5de-4dcd-a1ad-0f2b5ee9ab68%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.