Re: Help on convert PyObject to string (c) Python 3.6

2018-02-19 Thread Jason Qian via Python-list
Thanks a lot and I will take a look Cython, On Mon, Feb 19, 2018 at 3:23 PM, Stefan Behnel wrote: > Jason Qian via Python-list schrieb am 04.02.2018 um 17:52: > >This is the case of calling python from c and the python function > will > > return a string. > > Hi Jason, > > I noticed that you

Re: Help on convert PyObject to string (c) Python 3.6

2018-02-19 Thread Stefan Behnel
Jason Qian via Python-list schrieb am 04.02.2018 um 17:52: >This is the case of calling python from c and the python function will > return a string. Hi Jason, I noticed that you ran into a couple of problems using the C-API, so I suggest looking into Cython instead. It basically translates

Re: Help on convert PyObject to string (c) Python 3.6

2018-02-04 Thread Jason Qian via Python-list
Hi Chris, Thanks a lot ! Using PyUnicode_DecodeUTF8 fix the problem. On Sun, Feb 4, 2018 at 12:02 PM, Chris Angelico wrote: > On Mon, Feb 5, 2018 at 3:52 AM, Jason Qian via Python-list > wrote: > > Hi, > > > >This is the case of calling python from c and the python function > will > >

Re: Help on convert PyObject to string (c) Python 3.6

2018-02-04 Thread Chris Angelico
On Mon, Feb 5, 2018 at 3:52 AM, Jason Qian via Python-list wrote: > Hi, > >This is the case of calling python from c and the python function will > return a string. > >It seems python been called correctly, but got error when convert the > python string to c string. > > -- c -- > >PyO