Python API Functions equivalent to ruby's rb_big2str() andrb_str2cstr()

R

rahul

Is functions equivalent to ruby's rb_big2str() and rb_str2cstr()
available in Python.
I had search a lot in google but not able to find that.
If anybody know than please give me the name of those functions of
Python.
 
R

rahul

Please don't assume that we know what the Ruby functions are doing. You
need to explain them or at least provide a link to some docs.

Christian

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

Hrvoje Niksic

rahul said:
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.
 
J

John Machin

*base*


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

*base*

equivalent of

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

ALL of your base are want to be convert by us -- not merely 10.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top