Python API Functions equivalent to ruby's rb_big2str() and rb_str2cstr()

Hrvoje Niksic hniksic at xemacs.org
Tue May 12 09:48:52 EDT 2009


rahul <rahul03535 at gmail.com> writes:

> Hi Christian,
>   rb_big2str(Big-Integer, base) of ruby returns string representation
> of big-Integer. now, i am able to find equivalent python API function
> of rb_str2cstr() of ruby.

That would be PyLong_FromString, for the sake of later searches.

> so , please help me about rb_big2str(Big-Integer, base) equivalent of
> Python API function which i can use in extended module in c.

You can use PyObject_Str(long_object) to convert long to string.  No
special function is needed.



More information about the Python-list mailing list